Thursday, September 16, 2010

More about Linux Man page

Q1) How to know the options of ‘man’ command?   
# man man    (or)  # info man

Q2) How can we search for man pages?
# man  -k  <command / string>

Q3) How can we convert the Man pages into file so that we can take a printout or save it for future reference?   
# man [command name] | col -b > filename
E.g: # man vim | col -b > vim_manpage
Note:  Using 'col -b' will filter reverse line feeds.


Q4) When we get into the folder /usr/share/man, we would see folders such as man1, man2, man3, man4 ......man9. what are all those?  
At times you would have noticed something like "refer man5 page" etc. What it refers to ? 

Explanation:
Some commands have multiple man pages. For instance, the ‘passwd’ command has a man page in section 1 and another in section 5. By default, the man page with the lowest number is shown.
If you want to see another section than the default, specify it after the man command:

# man 5 passwd

If you want to see all man pages about a command, one after the other, use the -a to man:
# man -a passwd
This way, when you reach the end of the first man page and press SPACE again, the man page from the next section will be displayed.

No comments:

Post a Comment