有臺虛擬機,用的時候發現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