I often want to search through a man
page, however I am forced to either do:
man <package> | grep <search>
Or:
man <package> > file.txt
But there must be an easier way than this to do this, so how can I search through a man
page while in it instead of having to send its contents to a file, or use grep
to print the necessary matching contents to standard output?
Best Answer
While you can pipe
man
's output just fine, know that you can search withinman
as well.man
usesless
as the pager by default, and withinless
, you can:/
and enter the text you wanted to search forn
to go the next search result andN
to go the previous search resultg
to go to the top (since the search doesn't wrap around by default)Also see: