LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I look for specific options in a man page? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-look-for-specific-options-in-a-man-page-845075/)

protolocke 11-18-2010 09:06 AM

How do I look for specific options in a man page?
 
Say I want to lookup the compiler flag -Wall under the man page for the GNU fortran compiler gfortran.

I know that 'man gfortran' will get me the manual page for gfortran, but how do I lookup only the bit I want, which is '-Wall'? I can't find anything in the manual page for man.

I could use 'man gfortran | grep -Wall' but that would return just a single line and not the whole paragraph.

Thanks for any help

AlucardZero 11-18-2010 09:40 AM

Search by pressing / then typing -Wall

'n' to move to the next match.

Dark_Helmet 11-18-2010 10:18 AM

Just as a side note, on my system, I need to escape the dash to find a match. So, in the man page, I need to type:

/\-Wall

Not quite sure why that is. I never looked into it to find out.

chrism01 11-19-2010 12:13 AM

If you normally have access to the web, http://linux.die.net/man/

protolocke 11-19-2010 06:13 AM

Quote:

Originally Posted by AlucardZero (Post 4163201)
Search by pressing / then typing -Wall

'n' to move to the next match.

Thanks, that's exactly what I was looking for

syg00 11-19-2010 06:31 AM

This is actually a facility of the paginater program, not the man-page itself. Generally less in distros these days - "man less" will help greatly I would think.


All times are GMT -5. The time now is 04:25 AM.