Sometimes I want to know what a specific flag means. For instance:
man apache2: (...) -L Output a list of directives together with expected arguments and places where the directive is valid.
So is there a way to use something like "man apache2 -L" and it tells me only what -L means? Would be great so save on browsing the manual.
No, not the way you want it. But do you know that you can search inside
man
? Most systems useless
as man browser, so you can search with the/
command (pressh
for more help). If you look for a specific switch, you can use the fact that these are formatted with an indentation at the beginning of the line most of the time and use a regexp:will search for the string
-link
as first non-whitespace character of a line. This way, you will most likely find the actual explanation of the switch and not possible references in other sections.I run
man commandname
and use/
to type a search string like your example of-L
.If your version of
man
usesless
as its pager you can use this Bash function to jump directly to the first occurrence of a given string in theman
page:Usage:
You can jump to a particular section of a series of pages:
When you press q then Enter to exit one
man
page and go to the next, the search will be done in it, too.