Wikipedia defines man pages as “extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems”. Just as the definition goes sometimes the documentation is so extensive that you are unable to find the data you need.
Actually it’s not a big deal to find a particular word. You would have noticed that the usual Ctrl+F won’t work here.
For finding a particular word just access the man pages by man command.
Then for finding a particular ‘word’ type /word followed by Enter.
Now the first word will be highlighted. For the finding the instances of that word in next pages of the man page press Space and the ‘word’ in the next page will be highlighted. That’s it.
This same method also can also be used in vi for searching words.
Here is an example.
Nice articles
Can you please write about how to configure man to use PageUp and PageDown to navigate through pages? It doesn’t always work by default is pretty obscure how it can be modified.
Thanks!
This actually depends upon the pager you use. In my case the pager is ‘less’ and PageUp and PageDown is used to navigate through pages.
Thanks, in my case the problem happened to be missing entries in terminfo (for PgUp and PgDown), since I’m using OpenSolaris, where this is absent by default. Adding them enabled these keys in less/man etc.
Seriously? It’s the easy,
How long has this feature existed? I’ve been using gnu/linux for a decade, and this is the first I’ve heard of it.
How could I have not known this?
Or, maybe a better question is, how would I have known this?
I just used this very utility to search for “search” in the man page for man.
Yes, I did “man man”, then searched for “search”.
I found nothing about searching for a word within a man page, only stuff about searching for man pages.
Regardless, thank you SO MUCH for sharing this.
It WILL prove infinitely useful.
@tony Thanks for your response.
Frankly speaking, I was stuck many many times when I wanted to search for a word in man pages. So I had to google a lot and thought it would be useful if I would share.
And about your search ” man man” . It definitely won’t give result. Actually this feature of searching is given by the pager you use. Most probably your pager would be ‘less’ . So if you try “man less” you can find this option.
Superb weblog, Just simply desired to opinion that i cannot connect to the feed reader, you may possibly want install the appropriate wp extension for that to workthat.
Hello there. Just did some web browsing and discovered this website. I went through this weblog post and it’s very wonderful. I bookmarked it and i am looking forward to your future blog posts. I also see that your weblog has some good linking done to it. I was thinking if you’d like to share your secrets and techniques on how to obtain that pr. At any rate wonderful read again. Amazing information you got here.
To find the first occurrence of [pattern] in foo’s man page, do
$ man foo|less +/[pattern]
If someone knows how to find the n-th occurrence, I’d be interested. Of course, once you do the above, tapping the ‘ n ‘ key will jump to the next occurrence
Good one