|
A very handy part of UNIX is the man pages (short for manual
pages). To get help for a particular command, you can type:
man [command]
For example, typing
man ls
will give you a list of all the options for the ls
command.
You can also do a keyword search, otherwise known as apropos,
by using the -k option. If you wanted to find out how to
change file permissions, you could type
man -k permissions
and it would give you a list of commands that have the
keyword "permissions" in their man page.
There are different sections of man pages, one for user
commands, one for system calls, one for administrative
commands, etc. These vary from system to system, but if you
do
man chmod
for example, and get what looks like C code, chances are
you're in the wrong section. At the top of the screen will be
a line that tells you the subject, the section number, and
the section title (ie., "User Commands", "System Calls",
etc.) Generally the section number is specified by
man [section number] [command]
User commands are almost always in section 1, so if you get
confused, try
man 1 [command]
For those who are interested, section 2 is generally system
calls. Doing a man of man itself will give you more system
specific details.
As a convention, if you see a command with a number after it,
such as open(2), it means that the command referred to is
from that section of the man pages. In this case, open(2)
refers to the system call open. For another example,
chmod(1) refers to the user command chmod. The
number in parentheses is not part of the command name.
|