It's a very important foundation, but I didn't understand it so much, so I investigated it. Explanation from LINUX
Commands built into the shell itself
Commands that exist on the file system as executable files Cannot refer to the value of the set shell variable Environment variables are set when you want to use the value of a variable from an external command.
It is called a command search path, and the command can be executed simply by entering the command name (without specifying the full path) because the path where the command exists is set in this variable. If you execute a command with the path omitted, the paths defined in this variable are searched in order, and when a matching command is found, that command is executed.
You can refer to the environment variable currently set in echo $ PATH
Recommended Posts