Linux下ipconfig命令报:command not found 解决方法
  • 遇见的问题

Linux下ipconfig命令报:command not found 解决方法_安装包

  • ipconfig命令失败,说明没有将ipconfig命令配置到环境变量。 需要配置,方法如下

    • 查看/sbin 是否在PATH
    echo $PATH
    

    Linux下ipconfig命令报:command not found 解决方法_centos_02

    • 使用管理员权限 运行以下命令
    su
    vi /etc/profile
    
    # 在profile文件里面
    PATH=$PATH:/sbin
    export PATH=$PATH:/sbin
    

    Linux下ipconfig命令报:command not found 解决方法_安装包_03

    • "Esc" + ":wq" 保存文件
    • 让配置文件生效
    source /etc/profile
    
  • 但是如果你安装的是CentOS最小安装包模式,那就需要安装网络工具

    yum install upgrade
    yum install net-tools
    
  • 安装完后,再次执行ifconfig,显示成功

Linux下ipconfig命令报:command not found 解决方法_linux_04

Love and Share