Demonstrate Practical Use Cases of whatis Command
In this final step, you will explore some practical use cases of the whatis
command.
One common use case is to quickly find the purpose of a command or system component when you're unsure of its function. For example, let's say you encounter the du
command and want to know what it does:
whatis du
Example output:
du (1) - estimate file space usage
This tells you that the du
command is used to estimate file space usage.
Another use case is to search for related commands or utilities when you know the general purpose, but not the specific command name. For instance, if you want to find commands related to managing user accounts, you can use the -a
option:
whatis -a user
Example output:
adduser (8) - add a new user or update default new user information
deluser (8) - remove a user account and related files
usermod (8) - modify a user account
useradd (8) - create a new user or update default new user information
userdel (8) - delete a user account
This gives you a list of commands related to user management, which can help you find the right tool for the task at hand.
Finally, the whatis
command can be useful for quickly checking the manual section of a command or component. This is especially helpful when a command has the same name as a file format or system component. For example:
whatis -n 5 passwd
Example output:
passwd (5) - password file
This shows that passwd
has a manual page in section 5, which covers file formats, rather than the user command in section 1.