Try the apropos command(or man -k) to find the name of a command.

If you know what you want to do, but you don’t know what command does it, another thing to try is the apropos command. apropos prints out a one-line summary of commands, based on a keyword search.

For example, suppose you want to get a count of the number of words in a file. You know that there’s a command that does it, you just don’t know what it is. Try running:

% apropos words
look (1) find words in the system dictionary
canonhdr (8) \canonicalize case in keywords
wc (1) count lines, words and characters

At the very last line, you see that the wc command does what you want — it counts the number of lines, words, and characters in a file.

The success of apropos depends on your system administrator having created a special database for each directory tree of manpages, stored in a file called whatis. If you get an error message similar to the following:

% apropos words
/usr/local/man/whatis: No such file or directory

then your administrator has not created the database. Send her email with the full text of the error message.

The apropos command is the equivalent of running man with the -k option.

Get WYNTK: UNIX System Admininistrator now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.