Finding-Help Tips

Donnie Barnes, djb@redhat.com V1.0, January , 1996

1 Preface

“Red Hat Tips” are documentation meant to help Red Hat users with specific tasks. Some of these documents are for new users, some are for advanced users. Hopefully each document will also be of help for both new and advanced users. If you have contributions to make, please send them to tech-sup@redhat.com. If you have changes that need to be made to individual Tips, send them to the author of that document.

2 Introduction

This document is intended to help the user find help on his/her own system quickly and easily. Failing that, this document also contains pointers to very valuable information from other sources.

3 On Line Help

When you are looking for general help on commands and error messages, the best place to start is right on your system.

3.1 Man Pages

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 quit

• Enter to page down line by line

• Space to page down page by page

• b to page back up by one page

• / followed by a string and Enter to search for a string

• n to find the next occurance of the previous search 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 | 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).

3.2 Package Documentation

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.

3.3 HOWTOs and FAQs

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.

4 The “locate” Command

When you don’t know the full name of a command or file, but need to find it, you can usually find it with locate. locate uses a database to find all files on your system. Normally, this database gets built from a cron job every night. This won’t happen, however, if your machine isn’t booted into Linux all the time. So, if that is the case, you may occasionally want to run the following command:

     /usr/bin/updatedb --prunepaths='/tmp /proc /mnt /var/tmp /dev'

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:

     locate finger

It should return something like:

     /usr/bin/finger
     /usr/lib/irc/script/finger
     /usr/man/man1/finger.1
     /usr/man/man8/in.fingerd.8
     /usr/sbin/in.fingerd

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.

5 “info” Pages

While man is the most ubiquitous documentation format, info is much more powerful. It provides hypertext links to make reading large documents much easier and many features for the documentation writer. There are some very complete info documents on various aspects of Red Hat (especially the portions from the GNU project).

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 C-h C-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 the Tab key 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 C-x C-c (that’s 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.

6 Red Hat Mailing Lists

If you can’t find help for your problem on line and you have WWW access, you should see http://www.redhat.com/mailing-list.html. Here you can search the archives of the redhat-list. Most all questions have already been answered there.

If you’ve exhausted all options in finding help for your problem, you next best alternative is to ask for help on the Red Hat Mailing Lists. For the most up to date info, see http://www.redhat.com/mailing-list.html.

The request addresses for each of our lists is:

     redhat-list-request@redhat.com
     redhat-digest-request@redhat.com
     redhat-announce-list-request@redhat.com
     redhat-devel-list-request@redhat.com
     rpm-list-request@redhat.com
     axp-list-request@redhat.com
     sparc-list-request@redhat.com

To subscribe, send mail to the address of the list you want to subscribe to with “subscribe” in the Subject line.

To unsubscribe, send mail to the address of the list you want to unsubscribe from with “unsubscribe” in the Subject line.

Then to send mail to the list, you just send it to the address above without the “-request” in the name. The only exception to this is the redhat-digest which is only a digest version the redhat-list. In that case the address is “redhat-list@redhat.com”.

7 USENET Newsgroups

Another good source of help is the comp.os.linux hierarchy on USENET. If you are familiar with news, you should check it out. I won’t go into using News here. There will be a “Using News” Tips document at some point to help with that.

8 Copyright Notice

This document is Copyright (C) 1996 by Red Hat Software. Redistribution of this document is permitted as long as the content remains completely intact and unchanged. In other words, you may reformat and reprint or redistribute only.