centos :运行ifconfig 提示command not found

centos 运行ifconfig等命令, 提示command not found
原因:/bin  /sbin等一些的路径并未添加到环境变量中
不妨做个试验:
cd /etc/sbin

./ifconfg
正确显示结果。
编辑/etc/profile等文件,将这些路径添加至环境变量中
eg:
vi /home/用户目录/.bash_profile中添加
PATH=$PATH:$HOME/bin:/sbin:/bin
export PATH

猜你喜欢

转载自stefan321.iteye.com/blog/1621591