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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章