ifconfig command can not be found, suggesting bash: ifconfig: command not found

Original link: http://www.cnblogs.com/qypt2015/p/7270144.html

Question is entitled as concrete solutions shots are as follows:

Analyze problems 
1.whereis ifconfig look at the order in which directory 

2.echo $ PATH look at whether the directory path, note the lunux is completely case-sensitive, so do not ignore this point 

3. Run the need add the directory path specified in the pATH or 
4 can then be accessed such 
method: [root @ localhost sbin] $ / sbin / ifconfig can occur using 
method two: [root @ localhost sbin] $ export pATH = $ pATH: / sbin, this setting, next time you can directly visit, the first trouble-free place, such as: 
[root @ localhost /] $ ifconfig 

method three: modify / etc / profile file, comment out the if statement to 
the following the if statement commented: 
# the Path Manipulation 
if [ "$ the EUID" = "0"]; the then 
pathmunge / sbin 
pathmunge / usr / sbin 
pathmunge / usr / local / sbin 
Fi 
modify 
# Manipulation the Path 
# if [ "$ the EUID" = "0"]; the then 
pathmunge / sbin 
pathmunge / usr / sbin 
pathmunge / usr / local / sbin 
#be 

Second operating method of Example:

In the terminal or plain text interface, open the file .bash_profile in the user's home directory
#cd ~ into the user directory, or can not find the file .bash_profile
#ls -a
#vi .bash_profile
behind the line PATH plus / sbin, with separated by colons, such as
PATH = $ PATH: $ HOME / bin: / sbin
exit save,

source .bash_profile

Or re-logout, login, you can enter into force.

Reproduced in: https: //www.cnblogs.com/qypt2015/p/7270144.html

Guess you like

Origin blog.csdn.net/weixin_30932215/article/details/94786390