Less -S or –chop-long-lines option causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## create a file with long lines > myfile; i=1; while [ $i -le 20 ]; \ do echo "$i" >> myfile; ((i++)); done ps -ax | sed 's/[^A-Za-z0-9]//g' | tr -d '[ \n]' >> myfile echo >> myfile i=21; while [ $i -le 100 ]; \ do echo "$i" >> myfile; ((i++)); done ## default less myfile ## warp long lines ## less -S or --chop-long-lines option less -S myfile ## truncate long lines rm myfile |