How do I check man pages for what single parameter of the command does?
Search
x
is for extract
.
After you are inside man, type /-x
enter to search info about the -x parameter,
Press n
to jump to the next -x match, and N
for the previous
Search with Regex
For large man pages, or a common terms, a little regex can be used to narrow the search.
If you just want the main entry, you can use /^ *-x
to remove most extraneous matches.
This works as most man pages are formatted with the entry indented with spaces.
^ *
matches the start of line, with zero to many spaces.-x
is the search string.
This works in RHEL6 with Bash
In .bashrc
add
function mans {
man $1 | less -p "^ +$2"
}
start a new instance of bash
$ bash
now
mans ls -l
has the desired effect.
You could also grep
it out of the man page with some context:
man tar | grep -C5 -- '-x\b'