ifconfig命令無法識別,提示“Command 'ifconfig' is available in '/sbin/ifconfig'”

有臺虛擬機,用的時候發現ifconfig命令不好用了,提示如下:

Command 'ifconfig' is available in '/sbin/ifconfig'
The command could not be located because '/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.
ifconfig: command not found

根據提示,/sbin/這個路徑並沒有添加到系統的PATH。排查發現是/etc/bash.bashrc下的PATH被修改了,在最後添加上系統路徑的配置即可:

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章