The command line can be so tough for many people. Part of that remembering multitudes of commands can be so overwhelming and frustrating. To use the command effectively, I will explain 3 simple commands that will make your life easier.
Unfortunately, you can’t avoid the fact that you need to learn the commands, but there are some tools that can help you when you are struggling to remember commands.
Man
This command is a command-line utility that displays information on other commands and how they work.
To use the man command, simply type the following command at the terminal:
. man <command>
For example, to view the manual page for the useradd command, you would type the next command:
man useradd
As you can see, the man command opened the manual page and also supports a number of options that allow you to customize the output of the manual page.
Another example, of how to use man command:
man -k user: Search for manual pages that contain the keyword “user”
whatis
This command displays a brief description of a command on a single line.
To use the whatis command, simply type the following command at the terminal:
whatis <command>
For example, to view the manual page for the useradd command, you would type the next command:
whatis useradd
The whatis command will print the following output:
apropos
This command helps you find other commands.
To use the apropos command, simply type the following command at the terminal:
apropos “ word ”
For example, to search for commands that contain the keyword “change password”, you would type the following command:
apropos “ change password”
The apropos command will print a list of all commands that contain the keyword “change password”.
If your search doesn’t match the description, there is something extra you can do:
By using the -a flag, you can add together search terms in a more flexible way. Try this command:
apropos -a change password
The apropos command is a powerful tool that can be used to quickly find commands and utilities on a Linux system. It is particularly useful when you do not remember the exact name of a command, but you know a few keywords that are related to the command’s functionality.