Alias and absolute PATH/bin/rm are mentioned before the PATH configuration of Linux environment variables. Then, you realize that no, why did we directly run the command when we input many commands, without the absolute path to use these commands? This is because the environment variable PATH is working. Enter echo $ PATH. The echo here is actually the meaning of printing, and the $ in front of PATH indicates that the variable is followed. Www.2cto.com because/bin is in the PATH setting, you can naturally find ls. If you move ls to the/root directory, then you are also under the/root directory. But when you execute ls, he ignores you? What should I do? This is because the PATH does not have the/root directory, and you have moved the ls to the/root directory, so the system cannot find the executable file, so it will tell you, commandnotfound! So how can we overcome this problem?
There are two methods, one is to directly add the/root PATH to the PATH! How to add? You can use www.2cto.com PATH = "$ PATH":/root. Another method is to use the full file name, that is, directly use the relative or absolute PATH for execution. For example: /root/ls. /ls does not know where the command is to use # whereis useradd