Helping Yourself

Commands covered in this section: man

The On-line Manual

Each system has its man (short for manual) pages, they usually have detailed information on what a given command does, its syntax, any optional settings, the output it produces, and the various context in which it can be used. But this is not all the man pages can do for you. They also have details of system calls, functions/routines used for UNIX programming and file formats, in a few words you learn all your UNIX by using the man pages and by practise. So use the man command and learn....



Reading a man page

Nothing simpler! (Who said UNIX was complex), type man name, where name is the name of the command you wish to know more about. This will display the manual page for that command on your screen. You might want to keep the page for future reference, if this is the case type man name | col -b > filename. This will convert your manual pages to ASCII format and then store the page in a file for you.



Man for Programmers

What usually happens is that man displays only the first manual page, this is because the others, in most cases, contain details of how the command is used in a shell script/program. You might want this information, to display all the manual pages for a given command use man -a name.

Another useful feature of man is that if you use man -w name, man will display the location of the manual pages for the command specified by name, this information can then be used as the need may be.



Searching for a Command

If you are looking for a specific command but either can't remember its name or spelling use man -k keyword. This will cause man to search a database of on-line descriptions of manual pages and to display any matches found, man -k will tell you all you need to know on how to use man.
You can also use man -h to give a help message and exit.



Advanced Use of man

By default man will use the more pager. You can change the pager man uses by typing man -P pager name, where pager can be any pager that is locally available (for example less) and name is the name of your command.
Another useful feature of man is the -M option. Use man -M path name, where path is a path to look for the manual pages, and name you command. This feature is particularly useful if the manual page you are looking for is not in your MANPATH, or is on another system.



Environment variable for man

The following three environment variables effect the functions of man, you can override then by using the appropriate command line argument, but if you are planning to use these value often put them in the environment variables!

PAGER = the name of the pager to use for viewing of man pages
MANPATH = A list of path names, separated by colons, indicating the directories to search for man pages.
MANSEC = A list of manual sections to display (also colon separated).
Changing the values of any of these will effect how your man pages are found, displayed and which section of the man pages are displayed!


< Previous: Compression ^
Index

Frankie Blaskovic
Last modified: Sun Aug 10 12:00:32 BST 1997