Linux Man Pages

Getting help with Linux man pages

One excellent feature to be found on all Linux systems are the "Man Pages" manual pages. Here you will find information on almost every command and configuration file. As well as standard command information, many third party applications and software add information about their product to this area. Whenever you need to check syntax of a command or how a configuration file should be created, this is your first port of call.
To access the man pages you simply type "man" followed then by your enquiry. This could be "man ls" for information on the list command. "man /etc/resolv.conf" for information relating to the resolv.conf file. In our example, lets issue the "man ls" command. First, it is helpful to understand the layout of the man pages:




Man Page Layout


Topic Description
NAME Name and Description of command - entry
SYNOPSIS How to use the command
DESCRIPTION Description of the command or Entry
EXAMPLES Examples of how to use the command
SEE ALSO Further information available

The man pages can be found under /usr/share/man on most modern distributions. Within this location, the files are organised into the following categories. This can be useful when you are looking for information:

Section Description
man1 Executable programs or shell commands
man2 System calls (functions provided by the kernel)
man3 Library calls (functions within program libraries)
man4 Special files (Usually found in /dev)
man5 File formats and conventions e.g. /etc/passwd
man6 Games
man7 Miscellaneous (Including macro packages and conventions)
man8 System Administration commands (Usually only for root)
man9 Kernel routines [non standard]


Multiple Sections - Man Pages


Some topics within the man pages exist in more than one section. For instance, if we issue the command "whatis ip", we can see that information exists in Section(7) Linux IPV4 protocol implementation and also Section(8) show / manipulate routing and tunnels. To view the different sections we can issue "man 7 ip" or if we desired "man 8 ip".

How to find the right man page


Well thankfully there are ways to help us find the correct man page that we are looking for. For example, if we wanted to find information on the "mkfs" command, we could issue "man -k mkfs". This command would then search through the NAME section of the man pages looking for matches. An alternative to the "man -k" command is a command called "apropos". They are both the same really, "man -k" simply calls "apropos"


$ whatis ip
ip (7)               - Linux IPv4 protocol implementation
ip (8)               - show / manipulate routing, devices, policy routing and tunnels

$ man -k mkfs
jfs_mkfs (8)         - create a JFS formatted partition
mkfs (8)             - build a Linux filesystem
mkfs.bfs (8)         - make an SCO bfs filesystem
mkfs.btrfs (8)       - create an btrfs filesystem
mkfs.ext2 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext3 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext4 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext4dev (8)     - create an ext2/ext3/ext4 filesystem
mkfs.jfs (8)         - create a JFS formatted partition
mkfs.minix (8)       - make a Minix filesystem
mkfs.msdos (8)       - create an MS-DOS file system under Linux
mkfs.ntfs (8)        - create an NTFS file system
mkfs.reiserfs (8)    - The create tool for the Linux ReiserFS filesystem.
mkfs.vfat (8)        - create an MS-DOS file system under Linux
mkfs.xfs (8)         - construct an XFS filesystem

$ apropos mkfs
jfs_mkfs (8)         - create a JFS formatted partition
mkfs (8)             - build a Linux filesystem
mkfs.bfs (8)         - make an SCO bfs filesystem
mkfs.btrfs (8)       - create an btrfs filesystem
mkfs.ext2 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext3 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext4 (8)        - create an ext2/ext3/ext4 filesystem
mkfs.ext4dev (8)     - create an ext2/ext3/ext4 filesystem
mkfs.jfs (8)         - create a JFS formatted partition
mkfs.minix (8)       - make a Minix filesystem
mkfs.msdos (8)       - create an MS-DOS file system under Linux
mkfs.ntfs (8)        - create an NTFS file system
mkfs.reiserfs (8)    - The create tool for the Linux ReiserFS filesystem.
mkfs.vfat (8)        - create an MS-DOS file system under Linux
mkfs.xfs (8)         - construct an XFS filesystem




Help command


Another useful command that can return a lot of useful information regarding a command is the help command. To receive help about a command you need to issue you are trying to use followed by the parameter --help. The following example indicates the type of response you may receive. In this example we issue the "ip" command followed by the parameter "--help" :


john@john-desktop:~$ ip --help
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |
                   netns }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -f[amily] { inet | inet6 | ipx | dnet | link } |
                    -l[oops] { maximum-addr-flush-attempts } |
                    -o[neline] | -t[imestamp] | -b[atch] [filename] |
                    -rc[vbuf] [size]}


Info command


The "info" command can also be used to retrieve some very useful information regarding a command. It is always worth consulting all the different forms of help that are available. An example of the info command in action: "info ip (Note this is only an exert from the output).


File: *manpages*,  Node: ip,  Up: (dir)

IP(8)                                Linux                               IP(8)



NAME
       ip - show / manipulate routing, devices, policy routing and tunnels

SYNOPSIS
       ip [ OPTIONS ] OBJECT { COMMAND | help }


       OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel |
               maddr | mroute }


       OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet
               | inet6 | ipx | dnet | link } | -o[neline] }

Additional Resources


As Linux is a predominantly a community driven Operating System, there are many excellent online forums and communities you can visit for help. A quick search of your favourite Operating system within google should serve up the online forums you are looking for. Remember, If you do visit an online help forum, always search the archives first to see if someone has already asked about the same topic you are asking.