-->
Previous Table of Contents Next


Online Help Available in Linux

Linux has help facilities available online. If you forget the exact use of a command, which option means what, or if you’re looking for the right command to use, the answer might be available straight from Linux. The two help facilities we will try out are the bash shell’s help command and the man command, which is available on almost all UNIX systems, including Linux.

The Linux Man Pages

The “man” in “man pages” stands for “manual.” (As usual, the creators of UNIX shortened a long but descriptive word to a shorter, cryptic one!) Typing man <command> lets you view the manual pages dealing with a particular command.

Try typing man passwd to see what the Linux manual has to say about the passwd command.

The general layout of a man page is as follows:


COMMAND(1)      Linux Programmer’s Manual      COMMAND(1)

NAME

    command - summary of what command does

SYNOPSIS

    <complete syntax of command in the standard Linux form>

DESCRIPTION

    More verbose explanation of what “command” does.

OPTIONS

    Lists each available option with description of what it does

FILES

    lists files used by, or related to, command

SEE ALSO

    command_cousin(1), command_spouse(1), etc.

BUGS

    There are bugs in Linux commands??

AUTHOR

    J. S. Goobly (goobly@hurdly-gurdly.boondocks)

Linux 1.0               22 June 1994              1

The man page for passwd is actually quite understandable. Be warned, however, that man pages are often written in a very formal and stylized way that sometimes bears little resemblance to English. This is done not to baffle people, but to cram a great deal of information into as short a description as possible. For example, try entering man ls. Notice how many options are available for ls and how long it takes to explain them.

Although it can take practice (and careful reading!) to understand man pages, once you get used to them the first thing you’ll do when you encounter an unfamiliar command is call up the man page for that command.

Finding Keywords in Man Pages

Sometimes you know what you want to do, but you don’t know which command you should use to do it. Use the keyword option by typing man -k <keyword>, and the man program returns the name of every command whose name entry (which includes a very brief description) contains that keyword.

For instance, you can search on manual:


darkstar:~$ man -k manual

man (1)       - Format and display the online manual pages

whereis (1)   - Locate binary, manual, and or source for program

xman (1)      - Manual page display program for the X Window System

You have to be careful to specify your keyword properly, though! Using directory as your keyword isn’t too bad, for example, but using file gives you many more entries than you will want to wade through.


Note:  
You may have noticed that commands seem to be followed by numbers in brackets, usually (1). This refers to the manual section. Back in the days when UNIX manuals came in printed, bound volumes, normal commands were in Section 1, files used by administrators were in Section 5, programming routines were described in Section 3, and so on. Therefore, some man pages are not about commands at all, but rather about files or system calls used in Linux!

If a particular entry shows up in more than one section, man will show you the lowest-numbered entry by default. You can see higher-numbered entries by specifying the section number. For instance, Section 5 has a manual entry on the passwd file. To see this rather than the manual entry for the passwd command, type man 5 passwd.

In general, man <n> <entry> will find the man page for <entry> in Section <n>.



Previous Table of Contents Next