問題: ipconfig: command not found
[root@localhost root]# ipconfig
-bash: ipconfig: command not found
方法:
1、安裝好CentOS5.5后,ipconfig找不到那說明沒有將ipconfig命令配置到環境變量。
2、測試下結果echo $PATH,果然/sbin這個主要目錄不在PATH。
[root@localhost network-scripts]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/ #無/sbin命令路徑
3、使用管理員權限 運行vi /etc/profile 在文件末加入以下語句 :
PATH=$PATH:/sbin
export PATH=$PATH:/sbin
使用:wq!保存並退出。
[root@localhost boot]# vim /etc/profile 。 。 。 。 unset i unset pathmunge PATH=$PATH:/sbin export PATH=$PATH:/sbin "/etc/profile" 60L, 1071C
[root@localhost boot]#:wq
4、輸入命令:source /etc/profile,讓配置信息立即起效
再輸入ifconfig時就可以使用此命令了。