Normally, less will highlight ALL strings which match the last search command. The -g option changes this behavior to highlight only the particular string which was found by the last search command. This can cause less to run somewhat faster than the default.
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 ## default less myfile ## in the interactive mode type /9 to search 9 ## higlights all lines having 9 like 9, 19, 29 etc. ## less -g or --hilite-search options less -g myfile ## in the interactive mode type /9 to search 9 ## highlights only 9 rm myfile |