I often open man pages of a certain CLI tool only to check a particular flag, e.g. man iptables to check -t flag.Is there any tool that simplifies it? I could of course write a simple function in Bash grepping the contents of a man pages but I am looking for something that uses the structure of man pages to find exactly what I want (i.e. description of a certain flag).
Query Linux man page for certain flag
command line;man
I haven't found a API/mechanism for querying man pages for a certain flag. However, this simple function seems to do exactly what I need:function manswitch () { man $1 | less -p ^ +$2 }Usage:manswitch iptables -t