linux command which allows you to find the location of any commands in linux. And whatis command allows you to show the short description.
which and whatis command in Linux | with Examples
![]() |
which and whatis command |
Hello, guys welcome to the next session on Linux command line tutorial. In this session, I'm going to show you how you can use "which command" and "whatis command" in Linux.
First of all,
what is "which command" and how you can use it?
The "which command" is used to return the path-name of a "file" or a "command" which we use with this "which command".
"which" command
![]() |
"which" command |
$which command Name
Let's see how you can use it. So to use the "which command" you just need to write "which command name".
For example "which ls" press ENTER and this will give you the location of this "ls" command.
This "which command" will help you whenever you will be writing much of the "bash scripting".
And in "bash scripting" it's a good practice to use the full path of the command line name.
So instead of using "ls" in bash scripting use "/bin/ls". Which is the full location of this "ls" command.
Sometimes whenever you use your script in the different operating system some recognizes your "ls" Command.
Some want you to give the full path of the Command.
"whatis" command
![]() |
"whatis" command |
$whatis command Name
So let's see how we can use "whatis" command.
"whatis" command is going to display the short manual page description.
So just say "whatis ls" and press ENTER.
This "whatis" command is going to return you a short description of this "ls" command.
Conclusion
So this is how you can use "which" and "what is" command in Linux.
I hope you have enjoyed this tutorial please rate comment and bye.
HAVE A NICE DAY💖