less -c or –clear-screen option causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo "$i" >> myfile; ((i++)); done ## default less myfile ## scroll down using space bar ## no ~ is printed for lines after endoffile ## as full screen repaints are done by scrolling ## from the bottom of the screen ## less -c or --clear-screen option less -c myfile ## scroll down using space bar ## prints ~ for lines after endofline ## as full screen repaints to be painted ## from the top line down rm myfile |