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

7 Antworten [Letzter Beitrag]
PrimeOrdeal
Offline
Beigetreten: 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
Offline
Beigetreten: 08/25/2020

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

PrimeOrdeal
Offline
Beigetreten: 09/15/2019

Thanks!

gaseousness
Offline
Beigetreten: 08/25/2020

man less

should give a more complete list of shortcuts you could use

PrimeOrdeal
Offline
Beigetreten: 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!

I am a translator!

Offline
Beigetreten: 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!

I am a translator!

Offline
Beigetreten: 07/24/2010

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

PrimeOrdeal
Offline
Beigetreten: 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.