CentOS under ifconfig Run command not found error summary

Source: Internet
Author: User

Today after entering the CentOS to view the IP, execute ifconfig, but incredibly prompt: command not found. Look closely and find that the current user is not root. After using Su root to go to root, execute ifconfig again to prompt for invalid command. Why is that? After a search and access to data, the results are as follows:

The original use of Su although switched to root, but the environment variables are not followed by the change. So, perform "Su-" and make the environment variables come together as well. Most of the commands used by super users are in the/sbin, the general user command is generally in the/bin inside, and/bin inside is not ifconfig command.

So CentOS command not found


It's not going to be a very careful look down there.

Cause: Some paths such as/bin/sbin are not added to environment variables
You might do a trial:

Cd/etc/sbin

./ifconfg

Display the results correctly.
Edit files such as/etc/profile to add these paths to the environment variable
eg
vi/home/User Directory/.bash_profile add
Path= $PATH: $HOME/bin:/sbin:/bin
Export PATH


When the-bash:host:command not found is displayed, we need to install the corresponding package.

Host this program is the Bind-utils package inside the

Solutions


So we need to install Bind-utils first.


The code is as follows:

Yum Install Bind-utils


Summarize

Many of the default installation package will have some kits will not be installed, so you must first understand the relevant package of the basic knowledge Oh.
CentOS prompt command not found perhaps because of permission issues

Through SSH login to centos5.4, switch to root account, found a lot of command prompt not found, today to figure out what's going on, hey, it seems to need to learn from the foundation step by step. Knowledge points relate to user rights and user Switching.
Joe is a regular user and root is superuser.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.