Command Line · Lesson 17 of 19
whatis
0 / 4 checkpoints answered
When you recognize a command name but forget its purpose, whatis can provide a short reminder from the manual-page database.
Looking Up an Exact Name
Pass one or more exact topic names to whatis. Each result is derived from the NAME section recorded for an installed manual page:
$ whatis cat
cat (1) - concatenate files and print on the standard output
The output is a description, not a list of command options or examples. Use man cat or cat --help when you need more detail.
CheckYou know the name cat and want its one-line manual-page description. Which command should you run?
press 1/2/3 to answer · → next lesson
Reading Section Numbers
If the same topic has manual pages in several sections, whatis can display more than one result:
$ whatis passwd
passwd (1) - change user password
passwd (5) - the password file
The number in parentheses is the manual section. Here, passwd(1) describes the user command and passwd(5) describes a file format. You can open one explicitly with man 1 passwd or man 5 passwd.
CheckIn the output passwd (5) - the password file, what does (5) identify?
press 1/2/3 to answer · → next lesson
Choosing between whatis, man, and apropos
whatis NAME: Show concise descriptions for an exact manual topic name.man NAME: Open a full manual page.apropos KEYWORD: Search manual-page names and descriptions for a keyword.
For example:
$ apropos password
Use apropos when you know the task but not the command name. Use whatis when you already know the name.
CheckYou do not know a command's name, but you want to search manual descriptions for the keyword password. Which command fits that task?
press 1/2/3 to answer · → next lesson
When No Description Appears
If whatis reports that nothing is appropriate, the topic may not have an installed manual page or the manual database may be out of date. This result does not prove that no executable, alias, function, or builtin with that name exists. Use type NAME to see how Bash resolves a command name, then choose an appropriate help source.
Checkwhatis deploy finds no manual description. Which command checks whether Bash resolves deploy as an alias, function, builtin, or executable?
press 1/2/3 to answer · → next lesson
Summary
You can now retrieve and interpret concise descriptions from the manual database.
- Look up an exact topic with
whatis. - Read the manual section shown in parentheses.
- Use
manwhen you need the full page. - Use
aproposwhen you know a keyword rather than a name.
Lesson complete
You finished whatis. Nice work — keep the momentum going.