How to Use the which Command on Linux
When you try to run a program or command from the terminal window, the shell (usually, Bash on modern distributions) has to find that command and launch it. Some commands, such as cd, history, and pwd, are built into the shell, Well, Bash uses the path, which is actually a collection of paths, each of which points to a directory. It then searches each of those directories for an executable that matches the command or program
use echo to check the $PATH environment variable and see the directories in your path.
The output list separates each path with colons (:). On the computer we’re using, Bash will search the following directories in this order:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /user/games
- /usr/local/games
- /snap/bin
Shared On DLIKE
erm ... which command ? or we just doing the echo command