How to use the Linux whatis command
The Linux command whatis prints a brief explanation of a particular command on the command line. This way you can remember the usefulness of different commands and tools while working in the shell.
What is Linux whatis?
One of the advantages of Linux and Linux distributions like Debian or Ubuntu is the freedom the operating system and its components provide. Depending on the distribution, the possibilities are almost unlimited. One of the prerequisites is the correct use of the numerous Linux commands. To understand each of these commands, it helps to check out the manual, in addition to a guide like this one. Manuals offer extensive information about a command, its options and limitations. For a quick reminder about a command, the whatis command is a useful alternative.
How does the Linux whatis command work?
When you use the whatis command, you’ll get a concise description of the usefulness or purpose of a specific command directly on the command line. This information is typically just a few words long, serving as a helpful memory aid. For regular Linux users or individuals engaged in command line tutorials, this brief description often provides sufficient information to identify and utilise the desired command for their projects.
What is the syntax of Linux whatis?
The official syntax of the whatis command looks a bit complicated. However, the command is simple to use. This is the syntax:
$ whatis [-dlv?V] [-r|-w] [-s list] [-m system[,...]] [-M path] [-L locale] [-C file] name ...
bashYou can get information about more than one command. To do this, write the different commands one after the other.
What are the options of Linux whatis?
There are some options to customise the whatis command. The most important ones are:
- -d or –debug: This option outputs the debugging information.
- -v or –verbose: This option outputs additional detailed warnings.
Examples of the whatis command
To understand how whatis works, we’ll show you a few simple examples of how to use the command.
$ whatis passwd
bashThis outputs brief information about the Linux passwd command.
$ whatis cd killall
bashThis outputs information about the Linux cd command and the Linux killall command. These are specified one below the other.
$ whatis -d wget
bashThis way you can view the debugging information of the Linux wget command.