Causes all forward searches (not just non-repeated searches) to start just after the target line, and all backward searches to start just before the target line. Thus, forward searches will skip part of the displayed screen (from the first line up to and including the target line). Similarly backwards searches will skip the displayed screen from the last line up to and including the target line.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo "$i" >> myfile; ((i++)); done ## less -a or --search-skip-screen less -a -j30 -N myfile ## in the interactive mode type /9 to ## perform a forward search for 9 ## forward search starts from 29 ## less -A or --SEARCH-SKIP-SCREEN less -j30 -N -A myfile ## in the interactive mode type /9 to ## perform a forward search for 9 ## forward search starts from 19 ## default less -j30 -N myfile ## in the interactive mode type /9 to ## perform a forward search for 9 ## forward search starts from 9 (lines not skipped) rm myfile |