Get to know Linux: man pages
Have you ever had someone tell you to "RTFM" (aka: "Read The Flippin' Man page") only to realize you have no idea what man pages were? "Man pages" is short for "Manual Pages" and exist for both UNIX and Linux operating systems. Each man page is a self-contained document that holds all of the key bits of information you need to learn the basics of installed Linux commands and applications.
Of course the usefulness of a man page is dictated by the create of said page. Some man pages are an outstanding resource for learning about that particular application. Conversely, some man pages are fairly worthless. This article is not about discerning which man pages are worthwhile and which are not. This article will help you understand how best use the man command so you can make the most of this reference system.
Using the man command is easy. The structure of man is:
Where COMMAND_OR_APPLICATION is the command or the application you want to read about. But there are more ways to use the man command. If you issue the command man man you can read the man manpage (would that be a recursive command?).
There aren't too many useful switches to use with the man command. There is one switch, in particular, that is helpful - the k switch. The -k switch will search the collective man pages for the string you declare. For example, if you want to search all of the man pages for anything containing "net" you could issue:
man -k net
Any man page containing the string "net" will appear as such:
tcpd Â Â Â Â Â Â Â Â Â Â Â Â Â (8)Â - access control facility for internet services
tcpdump Â Â Â Â Â Â Â Â Â Â (8)Â - dump traffic on a network
telnet Â Â Â Â Â Â Â Â Â Â Â (1)Â - user interface to the TELNET protocol
What man pages contain
All man pages are supposed to follow the structure:
- Name: The name of the command or function with an included description.
- Synopsis: This is a description of what the command does or what parameters the function takes (and what header file contains its definition.)
- Description: A full description of the command or function.
- Examples: Examples of common usage.
- See Also: Related commands or functions.
Although it might seem the fastest way to learn about a command is to skip immediately to the Description. This is often not the fastest means of learning a command. Often the Synopsis will give you the structure of the command usage. You need this information to know where the switches and/or options go in the command structure. So make sure you examine the Synopsis first. Once you know how the command works you can jump down tot he description which is where much of the commands switches and options will be explained.
Of course most of the time a man page will only contain the bare bones of the information you need. For some it takes a while to grow accustomed to sifting out the useful information from the man pages.
Man pages are a great first place to look for information about a Linux/UNIX command/applicaiton or function. Many think the man page is antiquated, but there is still much to be learned from this simple information system. Give the man page a try so the next time someone says "RTFM" you can reply "I did, and I still am not sure what I am doing." (or better yet "I did and now I know everything I need to know.")Advertisement