Sometimes you only want to know what a command is for, without reading a whole manual page. whatis prints the one line summary.
Basic use
$ whatis ls
ls (1) - list directory contentsThe line has three parts: the name, the manual section in brackets, and the short description. It is taken from the NAME heading of the manual page.
You can ask about several names at once:
$ whatis cp mv
cp (1) - copy files and directories
mv (1) - move (rename) filesSeveral sections
A name can have pages in more than one section, and each gets a line:
$ whatis passwd
passwd (1) - change user password
passwd (1ssl) - OpenSSL application commands
passwd (5) - the password fileThe exact list and wording vary between distributions. Use the number with man, for example man 5 passwd, to read the page you want.
Nothing appropriate
$ whatis qwerty
qwerty: nothing appropriate.This means no matching page is in the index. The command might not exist, might have no manual page, or might be a shell built-in. It can also happen when the index has not been built yet. On many Linux systems an administrator can rebuild it with sudo mandb.
It does not prove that a command is missing. Check with type name.
whatis, apropos and man
whatis matches names. apropos searches names and descriptions for a keyword, which helps when you do not know the name:
$ apropos "list directory"
dir (1) - list directory contents
ls (1) - list directory contents
vdir (1) - list directory contentsman -f is equivalent to whatis, and man -k is equivalent to apropos. Once you have found the right command, use man for the details or --help for a quick list of options.
Try it
- Run
whatisonls,pwdandcat. - Run
whatis passwdand read the section numbers. - Try a made-up name and read the message.
- Use
apropos copyand pick one result to look up withman.
Check your understanding
whatis
All 4 sections ยท no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.