searching a man page?
Hi,
Once you have a man page open for a particluar command, how can you search the man page for a particular option? For example, I am trying to search man gcc. That man page is extremely long and I want to find out what the -I option does. How can I find the relevant description? In the preamble for that man page, it shows: Code:
Directory Options |
You can search simply by typing /-Bprefix and it will highlight all instances of that in the document.
|
well man pages are just text, man isn't responeible for things like that, but man uses less as the default pager, which responds very mich like vi / vim, so most non-editing vi commands work. in your case, just do "/ -I " to find it. also hitting n will go to the next ocurrence shoudl there be one.
|
Oops, I forgot the n part. You can check out the "Commands" section of less' man page for more options.
|
man gcc | grep -A 15 'I dir'
will find -I dir pluss the 15 lines following that match. Note: if you add the - with the I, grep will choke up for some reason. |
With all due respect, that's horrible! what about the 2nd line of the definition??
|
Eventually you can save the manual pages as text files and open them with your favourite editor. The command is
Code:
man gcc | col -b > man_gcc.txt |
You do that regularly do you? I guess whatever suits people best. old habits die hard...
|
Quote:
|
|
Quote:
|
All times are GMT -5. The time now is 08:50 PM. |