Less -# or –shift option specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. Alternately, the number may be specified as a fraction of the width of the screen, starting with a decimal point: .5 is half of the screen width, .3 is three tenths of the screen width, and so on.
If the number is specified as a fraction, the actual number of scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo -n "$i " >> myfile; ((i++)); done echo >> myfile tput cols ## check your current screen witdh ## default less myfile ## in interactive mode, press right-arrow ## moves right to one-half of current screen width ## ## less -# or --shift option less --shift 20 myfile ## in interactive mode, press right-arrow ## moves right to 20 charecter rm myfile |