How to know what a Linux command does using a terminal?

December 27, 2022 - 1 min read

To know what a Linux command does using a terminal, you can use the whatis command followed by the command you need to know as an argument to it.

For example, let's say we need to know what the mkdir command does or a small description of what it does.

To do that we can use the whatis command followed by the command itself which in our case is the command mkdir.

It can be done like this,

# Example: To know what the `mkdir` linux command does.
whatis mkdir

After executing the above command in the terminal, you can see an output like this,

# Output: whatis mkdir
mkdir(1)                 - make directories

According to the above output, a little description on the right-hand side states that the mkdir Linux command is used to create directories, and that is exactly what we need. Yay 🥳.

That's all 😃.