Man Options – View Man Page for Specific Command Option

manoptions

If I want to know the meaning of wget -b, I see the manual by man wget, then search the -b option.

   -b
   --background
       Go to background immediately after startup.  If no output file is specified via the -o, output is redirected to wget-log.

I want to get the result by a command like man wget -b. (Of course this doesn't work.)

Is there a similar way to make it possible?

Best Answer

You could redirect the manpage to awk and extact the part:

man wget | awk '/^ *-b *.*$/,/^$/{print}'
       -b
       --background
           Go to background immediately after startup.  If no output file is specified via the -o, output is redirected to wget-log.

That part is everything that is between a -b and an empty line.

Related Question