Home>Article>Operation and Maintenance> What should I do if CentOS prompts that the command cannot be found?

What should I do if CentOS prompts that the command cannot be found?

angryTom
angryTom Original
2020-03-18 12:25:41 7383browse

What should I do if CentOS prompts that the command cannot be found?

What should I do if CentOS prompts that the command cannot be found?

1. If a certain command cannot be found, it means that the corresponding software package is not installed. Use Just run yum install fb9567f3fd194d4da758ca91c4914633 to install it.

2. If all the commands cannot be found, the system environment variable PATH is wrong.The specific solution is as follows:

1. First check the value of the PATH variable

echo $PATH

Check whether the path contains:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin. If not, you need to add it manually;

(Recommended learning:Website Construction Tutorial)

2. Use the root user to modify the profile (environment configuration) file: (all users)

/usr/bin/vi /etc/profile

Add: export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Save and exit.

3. Modify the .bashrc file: (individual user)

/usr/bin/vi ~/.bashrc

Add: export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/ bin:/usr/sbin:/usr/bin

Save and exit.

4. Use source to make the configuration take effect

source /etc/profile source ~/.bashrc

Through the above operations, you will no longer be prompted that the command cannot be found.

This article comes from the PHP Chinese website,CentOS usage tutorialcolumn, please pay attention to this column for more related tutorials!

The above is the detailed content of What should I do if CentOS prompts that the command cannot be found?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn