想看本机ip,但是得到" bash: ifconfig: 未找到命令"信息

网上很多博客写要安装ifconfig和net-tools,跟着做了,还是不行,可能是没有配环境变量

看了一下 ifconfig在 /usr/sbin 目录下

deepin bash: ifconfig: 未找到命令

那就开始吧~

1. 进入/etc/profile文件

deepin bash: ifconfig: 未找到命令

2. 按G(大写哦),跳到文件末尾,按i进入编辑模式,在最后一行添加 export PATH=$PATH:/sbin, Esc退出编辑模式,然后 :wq! 保存并退出

deepin bash: ifconfig: 未找到命令

3. 输入 source /etc/profile使刚刚的更改生效

deepin bash: ifconfig: 未找到命令

4. ifconfig可用啦

deepin bash: ifconfig: 未找到命令

当然,你觉得改环境变量太麻烦,直接执行 /sbin/ifconfig也是可以的

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-08-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-15
  • 2021-06-19
  • 2022-01-01
  • 2022-03-04
  • 2022-12-23
相关资源
相似解决方案