Live Chat!

Basic text search in less

0 votos Vota!!

November 2nd, 2006 toydi Posted in Common, less | Hits: 8312 |

We usually use less as the default pager to display manuals and text files. Besides its basic navigation commands (up, down, pageup, pagedown, home, end), its text search commands may come in handy as well.
Let say we view a file:

less /usr/share/games/fortunes/linux

To search a keyword e.g. Linus, we type:

/Linus

A few more buttons to press:

  • n - forward to the next found line.
  • N - back to the previous line.
  • ESC+u - turn off the highlights.

and of course, the q to quit, h for help and what else.. you have tips? ;-)

One Response to “Basic text search in less”

  1. We are an innovative company, based in United Kingdom that provides a series of Web-based software applications that have helped customers create successful online initiatives. We provide all the services that a company needs to get online, from web designing to web hosting and above all website promotion in Google/Yahoo/MSN/AOL and other search engines.

Leave a Reply

Security Code: