2

How do I search man pages for options? I currently do this:

/-<option>

Example:

To see what grep -i does, I do this:

man grep and then /-i.

Or, I can do this:

man grep | grep .-i

Is there a better way of searching man pages for options?

Cohen K
  • 53
  • 1
    Not really, but you could make an alias for man | less -p <PATTERN> like http://unix.stackexchange.com/questions/18087/can-i-get-individual-man-pages-for-the-bash-builtin-commands – Mikel Dec 11 '12 at 03:12

1 Answers1

2

You can redirect the man output to gedit and then use "ctrl+F" to find whatever you want to.

man grep | gedit

which will show you man page of grep in a gedit window. Use find option. :)

  • 4
    How is this remotely better than using grep! – Cohen K Dec 12 '12 at 04:55
  • @CohenK gedit gives you find (ctrl+f) option where you can place search items exactly the way you want. You will not have to remember regex way of searching it or piping it through less/more/grep etc. I would not claim it as "better" way than using grep, but rather I would say this is another work around. Choices may differ :) . – Chandan Gupta Dec 12 '12 at 08:25
  • What's the point of doing all this when you can just search pressing / and typing?! Learning the Vim basics will help you move around man :) – Enrico Feb 18 '17 at 15:31