Man Command
This chapter will explain the use of man pages (also called manual pages) on your Unix or Linux computer.
Most Unix files and commands have pretty good man pages to explain their use. Man pages also come in handy when you are using multiple flavours of Unix or several Linux distributions since options and parameters sometimes vary.
1. man $command
Type man followed by a command (for which you want help) and start reading. Press q to quit the manpage. Some man pages contain examples (near the end).
2. man $configfile
Most configuration files have their own manual.
[root@ip-172–31–35–176 ~]# man syslog.conf
Reformatting syslog.conf(5), please wait…
3. man $daemon
This is also true for most daemons (background programs) on your system..
[root@ip-172–31–35–176 ~]# man syslogd
Reformatting syslogd(8), please wait…
4. man -k (apropos)
man -k (or apropos) shows a list of man pages containing a string.
[root@ip-172–31–35–176 ~]# man -k syslog
lm-syslog-setup (8) — configure laptop mode to switch syslog.conf … logger (1) — a shell command interface to the syslog(3) … syslog-facility (8) — Setup and remove LOCALx facility for sysklogd syslog.conf (5) — syslogd(8) configuration file syslogd (8) — Linux system logging utilities. syslogd-listfiles (8) — list system logfiles
5. whatis
To see just the description of a manual page, use whatis followed by a string.
[root@ip-172–31–35–176 ~]# whatis route
route (8) — show / manipulate the IP routing table.
6. whereis
The location of a manpage can be revealed with whereis.
[root@ip-172–31–35–176 ~]# whereis -m whois
whois: /usr/share/man/man1/whois.1.gz
This file is directly readable by man.
[root@ip-172–31–35–176 ~]# man /usr/share/man/man1/whois.1.gz
7. man sections
By now you will have noticed the numbers between the round brackets. man man will explain to you that these are section numbers. Executable programs and shell commands reside in section one.
8. man $section $file
Therefor, when referring to the man page of the passwd command, you will see it written as passwd(1); when referring to the passwd file, you will see it written as passwd(5). The screenshot explains how to open the man page in the correct section.
[root@ip-172–31–35–176 ~]# man passwd
# opens the first manul found
[root@ip-172–31–35–176 ~]# man 5 passwd
# opens a page from section 5
9. man man
If you want to know more about man, then Read The Fantastic Manual (RTFM). Unfortunately, manual pages do not have the answer to everything…
10. mandb
Should you be convinced that a man page exists, but you can’t access it, then try running mandb on Debian/Mint.
Or run makewhatis on CentOS/Redhat.