有台虚拟机,用的时候发现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
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐