Basic text search in less

November 2nd, 2006 toydi Posted in Common, less | Hits: 104949 | 13 Comments »

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? ;-)

13 Responses 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.

  2. I was just thinking about that, hmm awesome I wonder. Well thanks for the post really useful, to me anyway.

  3. Interesting. Well, I just have added your blog to my bookmarks and I hope you’ll keep posting post like that. Regards,

  4. Considerably, your blog post actually is very high this particular worthy topic. I concur jointly decisions and should thirstily expect see your approaching updates. Saying thanks will not just be adequate, considering the phenomenal lucidity in your writing. My goal is to at the grab your feeds to informed of the updates. Delightful work and far success in you as a customer endeavors

  5. Extremely superior content. We basically discovered a site not to mention desired towards mention who We have definitely liked looking through a website not to mention blogposts. Anyways I’ll turn out to be following a give food not to mention I just desire towards study a website yet again.

  6. Very nice post. I just stumbled upon your weblog and wished to say that I?I’ve genuinely enjoyed surfing around your blog posts. In any case I?beats by dre Ill be subscribing to your rss feed and I hope you write once more really soon!

  7. Great Works .Thanks for your shares.

  8. Mika Murzycki Says:

    Hi guys, this is a bit random but, I am looking for a licensed electrician in Tucson and I don’t know how to find one … I do know this local electrician is good. These guys are located in Tucson, not too far from my place I can’t find many reviews on them — Holy Ground Electric, 9420 E Golf Links Rd #252, Tucson, AZ 85730, (520) 971-6710

  9. Glen Ostler Says:

    Hello guys, this is a bit random but, I need to find a reliable electrician in Tucson and I don’t know who is good and who isn’t… I have heard this electrician in Tucson is good. They’re based out of located in Tucson, not too far from me I can’t find many reviews on them — Holy Ground Electric, 9420 E Golf Links Rd #252, Tucson, AZ 85730, (520) 971-6710

  10. Ahmad Wackerly Says:

    Hello everyone, this might not be the best place to ask this, but I am looking for a reliable electrician in Tucson and I don’t know who is good and who isn’t… I’ve been told this local electrician is good. These guys are near my home …anyone know them? — Holy Ground Electric 9420 E Golf Links Rd #252 Tucson, AZ 85730 (520) 971-6710

  11. Howdy! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely happy I found it and I’ll be bookmarking and checking back frequently!

  12. Very good, I like your article, continue to work hard, I will often come to pay attention!

  13. This is a very good article. I like it very much.

Leave a Reply