- 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
Read Descriptions of Commands
whatis
Earlier in this chapter you found out about the -f option for man, which prints onscreen the description of a command found in a man page. If you can remember that man -f presents that information, bully for you. It might be easier, however, to remember the whatis command, which does exactly the same thing: Displays the man page description for a command.
$ man -f ls ls (1) - list directory contents $ whatis ls ls (1) - list directory contents
The whatis command also supports regular expressions and wildcards. To search the man database using wildcards, use the -w option (or --wildcard).
$ whatis -w ls* ls (1) - list directory contents lsb (8) - Linux Standard Base support for Debian lshal (1) - List devices and their properties lshw (1) - list hardware lskat (6) - Lieutnant Skat card game for KDE [Listing condensed due to length]
Using wildcards might result in a slightly slower search than whatis without options, but it's pretty negligible on today's fast machines, so you probably don't have to worry about it.
Regular expressions can be used with the -r (or --regex) option.
$ whatis -r ^rm.* rm (1) - remove files or directories rmail (8) - handle remote mail received via uucp rmdir (1) - remove empty directories rmt (8) - remote magtape protocol module
Again, regular expressions are supposed to slow down the response you get with whatis, but you'll probably never notice it.
The whatis command is easy to remember (easier than man -f, some would say) and it quickly returns some important information, so memorize it.