演示环境

$ uname -a
Linux xxxxx-xxxxx-xxxx5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

1.关于

重装完系统,发现没有命令ifconfig

$ ifconfig
zsh: command not found: ifconfig

2.检查是否存在该命令

自己使用了ohmyzsh,检查配置文件的PATH中是否包含sbin目录,还需要检查sbin目录下是否存在ifconfig命令。

3.安装

  • 3.1 安装命令
$ sudo apt-get install ifconfig

失败,提示找不到该包

$ sudo apt-get install ifconfig
[sudo] password for cube:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ifconfig

*3.2 正确安装指令

ifconfig包含在net-tools中,该库还包含其他命令:whois

sudo apt-get install net-tools

安装结果

$ sudo apt-get install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 104 not upgraded.
Need to get 196 kB of archives.
After this operation, 864 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu focal/main amd64 net-tools amd64 1.60+git20180626.aebd88e-1ubuntu1 [196 kB]
Fetched 196 kB in 12s (16.6 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 166990 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...

4.使用ifconfig

$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 151 bytes 13005 (13.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 151 bytes 13005 (13.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 00

ubuntu无法找到ifconfig(command not found: ifconfig)的更多相关文章

  1. bash: ifconfig: command not found解决方法

    1.问题: #ifconfig bash: ifconfig: command not found 2.原因:非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况 ...

  2. ifconfig: command not found(CentOS专版,其他的可以参考)

    ifconfig: command not found 查看path配置(echo相当于c中的printf,C#中的Console.WriteLine) echo $PATH 解决方案1:先看看是不是 ...

  3. CentOS7 下ifconfig command not found解决办法

    今天尝鲜用VMWare安装了CentOS7,选择了最小安装包模式,安装完毕之后想查看一下本机的ip地址,发现报错 # ifcon -bash: ifconfig: command not found ...

  4. ifconfig: command not found 如何解决?

    ifconfig: command not found 查看path配置(echo相当于c中的printf,C#中的Console.WriteLine) 1 echo $PATH 解决方案1:先看看是 ...

  5. Linux系统ifconfig命令找不到,centos ifconfig Command not found

    centos ifconfig Command not found,Linux系统ifconfig命令找不到 >>>>>>>>>>>& ...

  6. CentOS 7.0下解决ifconfig: command not found的方法

    在CentOS7.0中输入ifconfig命令会遇到-bash: ifconfig: command not found. 在CentOS最小安装时是没有附带ifconfig,我们进入sbin目录下可 ...

  7. ifconfig: command not found(CentOS 7,其他的可以参考)

    ifconfig: command not found 查看path配置(echo相当于c中的printf,C#中的Console.WriteLine) 1 echo $PATH 解决方案1:先看看是 ...

  8. centos7 (ifconfig不能使用) -bash: ifconfig: command not found

    [root@localhost ~]# ifconfig -bash: ifconfig: command not found 输入ip addr 确认IP地址是否设置正常,设置好如下所示,如果没有获 ...

  9. rhel7 ifconfig command not found

    同事扔过来一个rhel7.2的系统,登录后发现没有安装ifconfig命令: # ifconfig -bash: ifconfig: command not found 先看看环境变量: # echo ...

随机推荐

  1. IDEA 配置背景颜色(豆沙绿)

    1. 定义方案名字(my color) Ctrl + Shift + a --> Color Scheme // 快捷定位配置 // 路径:File --> Settings --> ...

  2. Linux-root管理员创建新用户

    Linux 系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统.用户的账号一方面可以帮助系统管理员对使用系统的用户进行 ...

  3. gg=G

    1.代码格式化对齐 2.直接按下ESE模式下就可以来执行了

  4. 从零构建Java项目(Maven+SpringBoot+Git) #02 奥斯丁项目

    前两天我说要写个项目来持续迭代,有好多小伙伴都表示支持和鼓励,项目的第一篇这不就来了么~我给项目取了个名字,英文名叫做:austin,中文名叫做:奥斯丁 名字倒没有什么特别的含义,我单纯觉得这个名字好 ...

  5. 19. 删除链表的倒数第 N 个结点

    目录 19.删除链表的倒数第N个节点 题目 题解-暴力 题解-哈希表 题解-双指针 19.删除链表的倒数第N个节点 题目 给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点. 输入:he ...

  6. day08 外键字段的增删查改

    day08 外键字段的增删查改 今日内容概要 外键字段的增删查改 正反向查询的概念 基于对象的跨表查询(子查询) 基于双下划线的跨表查询(连表操作) 聚合查询与分组查询 F查询和Q查询 前提准备 cl ...

  7. ASP.NET Core中使用固定窗口限流

    算法原理 固定窗口算法又称计数器算法,是一种简单的限流算法.在单位时间内设定一个阈值和一个计数值,每收到一个请求则计数值加一,如果计数值超过阈值则触发限流,如果达不到则请求正常处理,进入下一个单位时间 ...

  8. nodeJs,Express中间件是什么与常见中间件

    中间件的功能和分类 中间件的本质就是一个函数,在收到请求和返回相应的过程中做一些我们想做的事情.Express文档中对它的作用是这么描述的: 执行任何代码.修改请求和响应对象.终结请求-响应循环.调用 ...

  9. 【leetcode】598. Range Addition II

    You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i ...

  10. Docker学习(三)——Docker镜像使用

    Docker镜像使用     当运行容器时,使用的镜像如果在本地中不存在,docker就会自动从docker镜像仓库中下载,默认是从Docker Hub公共镜像源下载. 1.镜像使用     (1)列 ...