any tips on efficient searching of man pages using grep / other commands

7 réponses [Dernière contribution]
PrimeOrdeal
Hors ligne
A rejoint: 09/15/2019

The man pages are great but can be quite long to search through by eye. Can anyone remind me of how to use any useful GNU/Linux commands (perhaps grep?) for searching the man pages automagically?

For instance I would like to search the man pages which would come up when typing "man sh" for a string such as "dummy" or "%k".

Any recommendations/suggestions?

Many thanks!

gaseousness
Hors ligne
A rejoint: 08/25/2020

up and down arrows scroll through previous searches, and n will find the next match of the search. q exits.

PrimeOrdeal
Hors ligne
A rejoint: 09/15/2019

Thanks!

gaseousness
Hors ligne
A rejoint: 08/25/2020

man less

should give a more complete list of shortcuts you could use

PrimeOrdeal
Hors ligne
A rejoint: 09/15/2019

Thanks. Can anyone tell me how to provide a filename which contains all of the man entries? Or do I need to pipe "man sh" into a file first? Or does less simply work on a data stream which is the one produced by "man sh"?

To cut a long question short - can anyone tell me what to type in order to use less for searching the output of "man sh" for the pattern "dummy" ("dummy" is just an example although its also a great album by Portishead)?

Magic Banana

I am a member!

Hors ligne
A rejoint: 07/24/2010

The output of man can be piped. But, as you were told, you probably want to learn less' search features.

Magic Banana

I am a member!

Hors ligne
A rejoint: 07/24/2010

Neither "dummy" nor "%k" occur in the manual of dash.

PrimeOrdeal
Hors ligne
A rejoint: 09/15/2019

Thanks, I know; I established that already thanks to the search methods kindly provided previously. Therefore "dummy" is just a dummy variable in this example.