linux -bash: ipconfig: command not found 解決方法


問題: 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時就可以使用此命令了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM