The help command par excellence in UNIX/Linux is the venerable man (system’s manual pager). The system’s manual is usually divided in 9 sections:
1- executable programs or shell commands
2- system calls (provided by the kernel)
3- library calls (provided by program libraries)
4- special files (usually in /dev)
5- file formats and conventions
6- games
7- miscellaneous (e.g. macros, conventions, etc)
8- system administration commands (usually only for root)
9- kernel routines
Most of the time we’ll get the help we need just by typing the command we need further explanations on:
# man chmod
But other times we will need to specify what section we want to look into. For example, passwd might refer to the command or to the configuration file /etc/passwd. If we do not specify the section, it will show the first hit which would be the command:
# man passwd → shows manual of command passwd
# man 1 passwd → shows manual of command passwd
# man 5 passwd → shows manual of /etc/passwd
# man -a passwd → shows all manual pages with passwd in the title in succession
If we are looking for help but don’t know exactly what section we should look into or don’t know exactly the word we should be searching for, then we can use the -k flag:
# man -k passwd
chpasswd (8) - update passwords in batch mode
fgetpwent_r (3) - get passwd file entry reentrantly
getpwent_r (3) – get passwd file entry reentrantly
gpasswd (1) – administer /etc/group and /etc/gshadow
htpasswd (1) - Manage user files for basic authentication
lpasswd (1) – Change group or user password
lppasswd (1) - add, change, or delete digest passwords.
pam_localuser (8) - require users to be listed in /etc/passwd
pam_passwdqc (8) - Password qualitycontrol PAM module
passwd (1) - update user’s authentication tokens
sslpasswd (1ssl) - compute password hashes
passwd (5) - password file
passwd2des (3) – RFS password encryption
passwdqc.conf (5) – libpasswdqc configuration file
pwhistory_helper (8) - Helper binary that transfers password hashes from passwd or shadow to opasswd
saslpasswd2 (8) - set a user’s sasl password
smbpasswd (5) – The Samba encrypted password file
smbpasswd (8) – change a user’s SMB password
vncpasswd (1) – change the VNC password
The -k flag looks for matches in the description of the command/file/etc. If we want a narrower search we can use the -f flag that looks for matches in the keyword only: