Previous Section  < Day Day Up >  Next Section

Recipe 1.3. Finding Appropriate man Pages

1.3.1 Problem

You need a program or utility to perform a specific function—for example, counting the words in a file—but you don't know what to look for. If you knew what you were looking for, you wouldn't need to look for it, right? How do you get out of this dilemma?

1.3.2 Solution

Do keyword searches with apropos or man -k. For example, if you want a command to count the words in a file, use:

$ apropos count words

or:

$ man -k count words

american-english (5) - a list of english words

grpconv (8)          - convert to and from shadow passwords and groups.

grpunconv (8)        - convert to and from shadow passwords and groups.

kmessedwords (1)     - a letter order game for KDE

lppasswd (1)         - add, change, or delete digest passwords.

pwconv (8)           - convert to and from shadow passwords and groups.

pwunconv (8)         - convert to and from shadow passwords and groups.

shadowconfig (8)     - toggle shadow passwords on and off

wc (1)               - print the number of newlines, words, and bytes in files

It doesn't matter which you use; apropos and man -k are the same. There are a lot of options, but wc looks like the program you want.

Remember the -f switch, to find all versions of a man page:

$ man -f manpath

manpath (1)      - determine search path for manual pages

manpath (5)      - format of the /etc/manpath.config file

1.3.3 Discussion

These commands perform keyword searches in the Description sections of the man pages. You can use any number of search terms, but the more you use, the more results you'll get, because they search each keyword in sequence.

Because these are literal keyword searches, broad concepts like "bandwidth shaping" or "user management" do not carry the same meaning for apropos and man -k; they see "bandwidth shaping" as two unrelated search terms, so single-word searches usually work best.

1.3.4 See Also

  • apropos(1), man(1)

    Previous Section  < Day Day Up >  Next Section