How to find out the various manpage sections to which a command belongs
So, last time we discussed different sections of man pages. We took the example of mkdir which had 2 manual pages - one as a command and the other as a system call. But what if we don't know the right manpage and want to find it out or just for kicks want to know under how many sections does a command come?(of course the usage would differ). This can be done easily using the whatis command.
Whatis command displays the man page description of the command or the name we supply to it as an argument. Lets take mkdir again as an example.
[shredder12]$ whatis mkdir
mkdir (1) - make directories
mkdir (2) - create a directory
This way it will display the description of all man pages by the name mkdir, hence telling us the different sections. Similarly, we can try out other commands too.
[shredder12]$ whatis open
open (1) - start a program on a new virtual terminal (VT).
open (2) - open and possibly create a file or device
The number in the category shows the section of man page to which the command and the corresponding description belong.



























Post new comment