Less -zn or –window=n or -n option changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The “z” may be omitted for compatibility with some versions of more. If the number n is negative, it indicates n lines less than the current screen size. For example, if the screen is 24 lines, -z-4 sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo "$i" >> myfile; ((i++)); done tput lines ## my one screenful size is 48 lines ## default less myfile ## in interactive mode type z to forward 1 window ## next window start from 48 ## less -zn or --window=n or -n option less -z20 myfile ## in interactive mode type z to forward 1 window ## next window start from 20 rm myfile |