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

angryTom
Release: 2020-03-18 12:25:41
Original
7437 people have browsed it

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 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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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 tutorial column, 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template