This recipe aims to explain a few commands we come across. Understanding these commands is helpful for users.
Let's go through each of the commands and their usage examples.
which command is used to find the location of a command. We type commands in the terminal without knowing the location where the executable file is stored.
When we type a command, the terminal looks for the command in a set of locations and executes the executable file if found at the location. This set of locations is specified using an environment variable
PATH. For example:
$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
We can export
PATH and can add our own locations ...