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:
Sometimes 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 | lpr
If you do have a postscript printer, you will probably want to print with:
man -t COMMAND | 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 makewhatis database has been created. Under Red Hat Linux, this is
done by a cron job overnight. If you don't leave your system running
overnight the database won't get created. If that is the case, run the
following command as the root user:
Once you've done that, you could enter man -k swapon.
That command would return:
So you can see that there are pages in section 2 and 8 both referring to
swapon (and swapoff in this case).
For the most part, the documents in this directory are ASCII. You can usually
view 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 enter:
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 , available from www.redhat.com.
Also, what if it's a command you need help with and the man page isn't
good? You could do something like:
Again, ``COMMAND'' is the actual command you need help with.
This will work only when the command is on your path.
/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
have to use gunzip to unzip them or use a command like:
The latter will work, but is a bit less flexible than unzipping and
then using more. However, unzipping 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 redbaron from Red Hat Software, or arena . You would
do something like:
/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.
You will need to be root on your system when doing that. That will allow
locate to work properly.
So, if you know you need to find all the ``finger'' files, you could run:
It should return something like:
One thing to note, however, is that locate not only returns hits
based on file name, but also on path name. So if you have a
/home/djb/finger/ directory on your system, it would get returned
along with all files in the directory.
To read info documentation, use the info program without
any arguments. It will present you with a list of available documentation. If
it can't find something, it's probably because you don't have the package
installed that includes that documentation. Install it with RPM and
try again.
If you're comfortable using emacs, it has a built in browser for info
documentation. Use [Ctrl-h] [Ctrl-i] to see it.
The info system is a hypertext based system. Any highlighted
text that appears is a link leading to more information. Use [Tab]
to move the cursor to the link, and press [Enter] to follow the
link. Pressing [p] returns you to the previous page, [n] moves you
to the next page, and [u] goes up one level of documentation. To
exit info, press [Ctrl-x] [Ctrl-c] (control-x followed by
control-c).
The best way to learn how to use info is to read the info documentation
on it. If you read the first screen that info presents you'll be
able to get started.
/etc/cron.weekly/makewhatis.cron
# man -k swapon
swapon, swapoff (2) - start/stop swapping to file/device
swapon, swapoff (8) - enable/disable devices and files for \
paging and swapping
6.1.2 Package Documentation
rpm -qdf /etc/sendmail.cf
rpm -qdf `which COMMAND`
6.1.3 HOWTOs and FAQs
zcat HAM-HOWTO.gz | more
cd /usr/doc/HTML
arena index.html
6.1.4 The ``locate'' Command
/etc/cron.daily/updatedb.cron
locate finger
/usr/bin/finger
/usr/lib/irc/script/finger
/usr/man/man1/finger.1
/usr/man/man8/in.fingerd.8
/usr/sbin/in.fingerd
6.1.5 ``info'' Pages