Less -J or –status-column option displays a status column at the left edge of the screen. The status column shows the lines that matched the current search, and any lines that are marked (via the m or M command).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo "$i" >> myfile; ((i++)); done ## less -J or --status-column option less -J myfile ## in the interactive mode, type /9 ## * is desplayed in the left of the screen ## where a match is found ## default less myfile ## in the interactive mode, type /9 ## only text is highlighted where match is found. rm myfile |