- Find Out About Commands with man
- Search for a Command Based on What It Does
- Quickly Find Out What a Command Does Based on Its Name
- Rebuild man's Database of Commands
- Read a Command's Specific Man Page
- Print Man Pages
- Learn About Commands with info
- Navigate Within info
- Locate the Paths for a Command's Executable, Source Files, and Man Pages
- Read Descriptions of Commands
- Find a Command Based on What It Does
- Find Out Which Version of a Command Will Run
- Conclusion
Locate the Paths for a Command's Executable, Source Files, and Man Pages
whereis
The whereis command performs an incredibly useful function: It tells you the paths for a command's executable program, its source files (if they exist), and its man pages. For instance, here's what you might get for KWord, the word processor in the KOffice set of programs (assuming, of course, that the binary, source, and man files are all installed):
$ whereis kword kword: /usr/src/koffice-1.4.1/kword /usr/bin/kword/usr/bin/X11/kword usr/share/man/man1/kword.1.gz
The whereis command first reports where the source files are: /usr/src/koffice-1.4.1/kword. Then it informs you as to the location of any binary executables: /usr/bin/kword and /usr/bin/X11/kword. KWord is found in two places on this machine, which is a bit unusual but not bizarre. Finally, you find out where the man pages are: /usr/share/man/man1/kword.1.gz. Armed with this information, you can now verify that the program is in fact installed on this computer, and you know now how to run it.
If you want to search only for binaries, use the -b option.
$ whereis -b kword kword: /usr/bin/kword /usr/bin/X11/kword
If you want to search only for man pages, the -m option is your ticket.
$ whereis -m kword kword: /usr/share/man/man1/kword.1.gz
Finally, if you want to limit your search only to sources, try the -s option.
$ whereis -s kword kword: /usr/src/koffice-1.4.1/kword
The whereis command is a good, quick way to find vital information about programs on the computer you're using. You'll find yourself using it more than you think.