When you are looking for general help on commands and error messages, the best place to start is right on your system.
Most every command on your system has an associated ``man'' page. This
is documentation that you can get to instantly should you have questions
or problems. If you were having trouble with the command ls, you
could enter man ls. This will bring up the man page for ls.
The man page is viewed through the less program, so all of the
options to less will work while in a man page. Some important
key strokes are:
q to quitEnter to page down line by lineSpace to page down page by pageb to page back up by one page/ followed by a string and Enter to search for
a stringn to find the next occurance of the previous searchSometimes viewing man pages isn't too friendly on line. Providing you
have a working printer, you can print man pages as well. If you don't
have postscript printing capability and just want to print ASCII, you
can print man pages with man COMMAND | groff -mandoc -Tascii | lpr.
If you do have a postscript printer, you will probably want to print
with man COMMAND | groff -mandoc | lpr. In both of
those commands substitute ``COMMAND'' for the command you are trying
to get help for.
Also, sometimes things have more than one man page. Here is a table of what is located where:
Section Contents
------- ----------------
1 user commands
2 system calls
3 library calls
4 devices
5 file formats
6 games
7 miscellaneous
8 system commands
9 kernel internals
So, let's say that you want to see the man page for swapon. You
do man swapon. You will actually get the man page for the system
call swapon(2), which is the function you use in a C program to
turn swap on. Unless you are writing your own program to do it, this
probably isn't what you want. So, using the chart above, you can see
that what you want is probably a ``system command'' and is located
in section 8. You can then do man 8 swapon. All of this is because
man searches the man directories in order, and then returns when it
finds the first match.
You can also search the man pages for strings. You do this using
man -k string_to_search_for. This won't work, however, unless
the database is created. Under Red Hat, this gets done by a cron
job overnight. If you don't leave your system on overnight you
won't have the database. If that is the case, just run:
/usr/sbin/makewhatis /usr/man /usr/X11R6/man
Note: This must be done as root. Once you've done that, you could do
man -k swapon. That would return:
# man -k swapon
swapon, swapoff (2) - start/stop swapping to file/device
swapon, swapoff (8) - enable/disable devices and files for paging and swapping
swapon, swapoff (2) - start/stop swapping to file/device
swapon, swapoff (8) - enable/disable devices and files for paging and swapping
So you can see that there are pages in section 2 and 8 both referring to swapon (and swapoff in this case).
Many packages of software have READMEs and other documentation as part
of the source package. We have come up with a standard place to install
those documents for you so that you don't have to install the sources
to look at the documents. All of those documents are stored in subdirectories
of /usr/doc. The subdirectory depends on the package. Each package
that has extra documentation will create a directory called
packagename-version-releasenumber. For example, the tin package might
be version 1.22 and release number 2. The path to its documentation would
be /usr/doc/tin-1.22-2.
For the most part, the documents in this directory are ASCII. You can usually
for them with more filename or less filename.
This is nice, but what if you want to see if there is documentation for a specific command or file and you don't know the package it came from? It doesn't matter! You can simply do:
rpm -qdf /etc/sendmail.cf
This will report all the documentation from the package containing the
file /etc/sendmail.cf. Commands like this are covered more in
depth in the RPM-HOWTO, most likely available wherever you got this
document.
Also, what if it's a command you need help with and the man page isn't good? You could do something like:
rpm -qdf `which COMMAND`
Again, where ``COMMAND'' is the actual command you need help with. This will only work when the command is on your path.
Most of the contents of the Linux Documentation Project (LDP) are
available in /usr/doc on your system.
/usr/doc/HOWTO contains the ASCII versions of all the available
HOWTOs at the time we pressed the CD-ROM. They are gzipped, so you will
have to use gunzip to unzip them or you will have to use something
like zcat HAM-HOWTO.gz | more. The latter will work, but is
a bit less flexible than unzipping and then using more. It also
requires more disk space unless you re-gzip the document when done.
/usr/doc/HOWTO/mini contains the ASCII versions of all the
available mini-HOWTOs. They are not compressed and can be viewed
with more or less.
/usr/doc/HTML contains the HTML versions of all the HOWTOs and
the _Linux Installation and Getting Started_ guide. To view things
here, just use a WWW browser (like lynx or Mosaic). You
would do something like:
cd /usr/doc/HTML
lynx index.html
/usr/doc/FAQ contains ASCII version (and some HTML versions)
of some popular FAQs, including the RedHat-FAQ. All of them can be
viewed using more or less.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter