Ifconfig命令详细解析

本文涉及的产品
云解析 DNS,旗舰版 1个月
公共DNS(含HTTPDNS解析),每月1000万次HTTP解析
全局流量管理 GTM,标准版 1个月
简介: 1.测试环境: [root@lvskeep ~]# cat /etc/redhat-release CentOS release 5.4 (Final) [root@lvskeep ~]# uname -r 2.

1.测试环境:

[root@lvskeep ~]# cat /etc/redhat-release

CentOS release 5.4 (Final)

[root@lvskeep ~]# uname -r

2.6.18-164.el5

[root@lvskeep ~]# ifconfig               #本机的网络配置

eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:11 

          inet addr:10.0.0.30  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a11/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:893 errors:0 dropped:0 overruns:0 frame:0

          TX packets:447 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:91733 (89.5 KiB)  TX bytes:84456 (82.4 KiB)

          Interrupt:185 Base address:0x1400

 

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:7942 (7.7 KiB)

          Interrupt:169 Base address:0x1480

 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1224 (1.1 KiB)  TX bytes:1224 (1.1 KiB)

说明:

eth0 表示第一块网卡, 其中 HWaddr 表示网卡的物理地址,我们可以看到目前这

个网卡的物理地址(MAC地址)是 00:0C:29:BC:7A:1B inet addr 用来表示网卡

IP地址,此网卡的 IP地址是 10.0.0.30, 广播地址,

Bcast:10.0.0.255,掩码地址Mask:255.255.255.0

 

lo 是表示主机的回坏地址,这个一般是用来测试一个网络程序,但又不想让局域

网或外网的用户能够查看,只能在此台主机上运行和查看所用的网络接口。比如我

们把HTTPD服务器的指定到回坏地址,在浏览器输入 127.0.0.1 就能看到你所架

WEB网站了。但只是您能看得到,局域网的其它主机或用户无从知道;

2.通过man命令查看系统自带的帮助

[root@lvskeep ~]# man ifconfig

NAME

       ifconfig - configure a network interface

 

SYNOPSIS   #摘要,概要,大意

       ifconfig [interface]

       ifconfig interface [aftype] options | address ...

 

DESCRIPTION

       Ifconfig is used to configure the kernel-resident network interfaces.  It is used at boot time to set up interfaces as necessary.  After that, it is usually only needed when debugging or when system tuning  is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces.  If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is  given, it displays the status of all interfaces, even those that are down.  Otherwise, it configures an interface.

 

Address Families

       If the first argument after the interface name is recognized as the name of a supported address family,that address family is used for decoding and displaying all protocol addresses.  Currently supported address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet Radio), ddp  (Appletalk

Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio).  All numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x or 0X implies hexadecimal; otherwise, a leading implies octal; otherwise,the number is interpreted as decimal). Use of hexamedial and octal numbers is not RFC-compliant and therefore its  use is discouraged and may go away.

 

OPTIONS

       Interface   #e.g eth0eth1

              The  name of the interface.  This is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.

e.g

[root@lvskeep ~]# ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:11 

          inet addr:10.0.0.30  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a11/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:673 errors:0 dropped:0 overruns:0 frame:0

          TX packets:338 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:68647 (67.0 KiB)  TX bytes:66442 (64.8 KiB)

          Interrupt:185 Base address:0x1400

     

 up     This flag causes the interface to be activated.  It is implicitly  specified  if  an  address  is assigned to the interface.

e.g

在虚拟机上执行ifconfig eth0 up命令,激活eth0

[root@lvskeep ~]# ifconfig eth0 up

[root@lvskeep ~]# ifconfig              #验证是否激活

eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:11 

          inet addr:10.0.0.30  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a11/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:893 errors:0 dropped:0 overruns:0 frame:0

          TX packets:447 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:91733 (89.5 KiB)  TX bytes:84456 (82.4 KiB)

          Interrupt:185 Base address:0x1400

 

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:7942 (7.7 KiB)

          Interrupt:169 Base address:0x1480

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1224 (1.1 KiB)  TX bytes:1224 (1.1 KiB)

看到eth0已经成功激活

down   This flag causes the driver for this interface to be shut down.

e.g

SecureCRT软件

[root@lvskeep ~]# ifconfig eth0 down

结果:光标不停闪烁

直接在虚拟机里操作

[root@lvskeep ~]# ifconfig

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:7942 (7.7 KiB)

          Interrupt:169 Base address:0x1480

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1224 (1.1 KiB)  TX bytes:1224 (1.1 KiB)

说明:执行ifconfig eth0 down命令后,网卡eth0就停掉了,不工作了,已经断开了连接,而SecureCRT就是通过eth0连接的虚拟机,所以光标会一直闪烁;通过在虚拟机上执行ifconfig命令验证,eth0确实停掉了。

       [-]arp Enable or disable the use of the ARP protocol on this interface.

e.g

[root@lvskeep ~]# ifconfig eth0 –arp             #关闭了ARP协议

执行完此命令后,SecureCRT和虚拟机断开连接。关闭ARPIP地址和MAC地址失去了对应关系,无法识别对应的主机。

[root@lvskeep ~]# ifconfig eth0 arp               #开启ARP协议

再次连接正常   arp  命令(附录一)

[-]promisc

              Enable or disable the promiscuous mode of the interface.  If selected, all packets on the network will be received by the interface.

 

       [-]allmulti

              Enable or disable all-multicast mode.  If selected, all multicast packets on the network will  be received by the interface.

 

       metric N   #指定在计算数据包的转送次数时,所要加上的数目

              This parameter sets the interface metric.

 

       mtu N  This parameter sets the Maximum Transfer Unit (MTU) of an interface.

              #设置网络设备的MTU

 

       dstaddr addr

              Set the remote IP address for a point-to-point link (such as PPP).  This keyword is now obsolete;use the pointopoint keyword instead.

 

       netmask addr

              Set the IP network mask for this interface.  This value defaults to the usual class  A,  B  or  C network mask (as derived from the interface IP address), but it can be set to any value.

e.g

[root@lvskeep ~]# ifconfig eth1 192.168.0.30 netmask 255.255.0.0    #子网掩码

[root@lvskeep ~]# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.255.255  Mask:255.255.0.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:11144 (10.8 KiB)

          Interrupt:169 Base address:0x1480

注意:netmask不能大写

       add addr/prefixlen

              Add an IPv6 address to an interface. #设置网络设备IPv6IP地址

 

       del addr/prefixlen

              Remove an IPv6 address from an interface.# 删除网络设备IPv6IP地址

 

       tunnel aa.bb.cc.dd

              Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.  #建立IPv4IPv6之间的隧道通信地址

 

       irq addr

              Set  the  interrupt  line  used by this device.  Not all devices can dynamically change their IRQ setting.# 置网络设备的IRQ

 

       io_addr addr  #设置网络设备的I/O地址

              Set the start address in I/O space for this device.

 

       mem_start addr    #设置网络设备在主内存所占用的起始地址

              Set the start address for shared memory used by this device.  Only a few devices need this.

 

       media type     #设置网络设备的媒介类型

              Set the physical port or medium type to be used by the device.  Not all devices can  change this setting,  and  those  that  can  vary  in  what values they support.  Typical values for type are 10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external  transceiver)and so on. The special medium type of auto can be used to tell the driver to auto-sense the media.Again, not all drivers can do this.

 

       [-]broadcast [addr] #将要送往指定地址的数据包当成广播数据包来处理

              If the address argument is given, set the protocol broadcast address for this interface.Other-wise, set (or clear) the IFF_BROADCAST flag for the interface.

 

       [-]pointopoint [addr] # 与指定地址的网络设备建立直接连线,此模式具有保密功能。

              This  keyword  enables  the point-to-point mode of an interface, meaning that it is a direct link between two machines with nobody else listening on it. If the address argument is also given, set the protocol address of the other side  of  the  link,just  like the obsolete dstaddr keyword does.  Otherwise, set or clear the IFF_POINTOPOINT flag for the interface.

 

       hw class address

              Set the hardware address of this interface, if the device driver supports  this  operation.   The

 

       multicast

              Set  the  multicast  flag on the interface. This should not normally be needed as the drivers set the flag correctly themselves.

 

       address

              The IP address to be assigned to this interface.

 

       txqueuelen length

              Set the length of the transmit queue of the device. It is useful to set this to small values  for slower  devices  with a high latency (modem links, ISDN) to prevent fast bulk transfers from dis-

              turbing interactive traffic like telnet too much.

 

NOTES

       Since kernel release 2.2 there are no explicit interface statistics for alias  interfaces  anymore.  The statistics  printed  for the original address are shared with all alias addresses on the same device. If  you want per-address statistics you should add explicit accounting rules for the address using  the ipchains(8) command.

Interrupt  problems  with Ethernet device drivers fail with EAGAIN. See http://www.scyld.com/expert/irq-conflict.html for more information.

 

FILES

       /proc/net/socket

       /proc/net/dev

       /proc/net/if_inet6

 

BUGS

       While appletalk DDP and IPX addresses will be displayed they cannot be altered by this command.

 

SEE ALSO

       route(8), netstat(8), arp(8), rarp(8), ipchains(8)

 

AUTHORS

       Fred N. van Kempen,

       Alan Cox,

       Phil Blundell,

       Andi Kleen

 

net-tools                       14 August 2000                     IFCONFIG(8)

实例:

1.如果我们想知道主机所有网络接口的情况,请用下面的命令:

[root@lvskeep ~]# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:11 

          inet addr:10.0.0.30  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a11/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2974 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1342 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:280167 (273.6 KiB)  TX bytes:214214 (209.1 KiB)

          Interrupt:185 Base address:0x1400

 

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:14376 (14.0 KiB)

          Interrupt:169 Base address:0x1480

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:108 errors:0 dropped:0 overruns:0 frame:0

          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11816 (11.5 KiB)  TX bytes:11816 (11.5 KiB)

 

sit0      Link encap:IPv6-in-IPv4 

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

2.如果我们想查看某个端口,比如我们想查看eth1 的状态,就可以用下面的方法

[root@lvskeep ~]# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:14376 (14.0 KiB)

          Interrupt:169 Base address:0x1480

ifconfig 配置网络端口的方法

ifconfig 工具配置网络接口的方法是通过指令的参数来达到目的的

ifconfig  网络端口  IP地址    hw   MAC地址  netmask  掩码地址  

broadcast  广播地址   [up/down]

3.ifconfig 来调试 eth1网卡的地址

[root@lvskeep ~]# ifconfig eth1 down

[root@lvskeep ~]# ifconfig eth1 192.168.1.30 broadcast 192.168.1.255 netmask 255.255.255.0

[root@lvskeep ~]# ifconfig eth1 up

[root@lvskeep ~]# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:0C:29:BC:7A:1B 

          inet addr:192.168.1.30  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:febc:7a1b/64 Scope:Link

          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:91 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:6622 (6.4 KiB)  TX bytes:21736 (21.2 KiB)

          Interrupt:169 Base address:0x1480

说明:

第一行:ifconfig eth0 down 表示如果eth0是激活的,就把它DOWN掉。此命令等同于 ifdown eth0

第二行:用ifconfig 来配置 eth0IP地址、广播地址和网络掩码;

第三行:用ifconfig eth0 up 来激活eth0 ; 此命令等同于 ifup eth0

第四行:用 ifconfig eth0 来查看 eth0的状态;

也可以用直接在指令IP地址、网络掩码、广播地址的同时,激活网卡;要加up参数

[root@lvskeep ~]# ifconfig eth1 192.168.1.30 broadcast 192.168.1.255 netmask 255.255.255.0 up

4.设置网卡eth1IP地址、网络掩码、广播地址,物理地址并且激活它

[root@lvskeep ~]# ifconfig eth1 192.168.0.30 hw ether 00:0C:29:BC:7A:11 broadcast 192.168.0.255 netmask 255.255.255.0 up

SIOCSIFHWADDR: Device or resource busy

先停掉然后再改,MAC地址最好别改,很容易出错,个人理解。

目录
相关文章
|
27天前
|
网络协议 开发工具 C语言
Jetson错误(二):wget命令提示无法解析主机地址的问题解决
对于解决在NVIDIA Jetson平台上使用wget命令时出现的无法解析主机地址的问题,提供了两种解决方法:一种是临时修改DNS服务器为Google的公共DNS,另一种是永久修改DNS设置。
48 5
|
2月前
|
存储 缓存 NoSQL
Redis 过期删除策略与内存淘汰策略的区别及常用命令解析
Redis 过期删除策略与内存淘汰策略的区别及常用命令解析
65 0
|
3月前
|
图形学 开发者 存储
超越基础教程:深度拆解Unity地形编辑器的每一个隐藏角落,让你的游戏世界既浩瀚无垠又细节满满——从新手到高手的全面技巧升级秘籍
【8月更文挑战第31天】Unity地形编辑器是游戏开发中的重要工具,可快速创建复杂多变的游戏环境。本文通过比较不同地形编辑技术,详细介绍如何利用其功能构建广阔且精细的游戏世界,并提供具体示例代码,展示从基础地形绘制到植被与纹理添加的全过程。通过学习这些技巧,开发者能显著提升游戏画面质量和玩家体验。
126 3
|
3月前
|
数据采集 运维 监控
运维笔记:流编辑器sed命令用法解析
运维笔记:流编辑器sed命令用法解析
56 5
|
3月前
|
Linux 数据安全/隐私保护 Perl
解锁Linux高手秘籍:文件操作+命令解析大揭秘,面试场上让你光芒万丈,技术实力惊艳四座!
【8月更文挑战第5天】Linux作为服务器与嵌入式系统的基石,其文件管理和命令行操作是技术人员必备技能。本文从文件操作和基础命令两大方面,深入浅出地解析Linux核心要义,助你在面试中脱颖而出。首先探索文件系统的树状结构及操作,包括使用`ls -la`浏览文件详情、`touch`创建文件、`rm -r`慎删目录、`cp`与`mv`复制移动文件、以及利用`find`搜索文件。接着掌握命令行技巧,如用`cat`、`more`和`less`查看文件内容;借助`grep`、`sed`与`awk`处理文本;运用`ps`、`top`和`kill`管理进程;并通过`chmod`和`chown`管理文件权限。
76 8
|
3月前
|
运维 Ubuntu Shell
Docker命令宝典:解锁容器化技术的无限可能,从镜像管理到容器操作,全面解析与实战指南!
【8月更文挑战第3天】Docker简化了应用的部署与运行,掌握其基本命令对开发者和运维人员至关重要。通过`docker images`可查看本地镜像;使用`docker pull`拉取如最新版Ubuntu镜像;`docker rmi`用于删除不再需要的镜像。运行容器可通过`docker run`命令,结合`-it`等选项提供交互式环境。`docker ps`显示运行中的容器,加上`-a`则列出所有容器。`docker stop`和`docker start`分别用于停止和重启容器,而`docker rm`则删除容器。
78 5
|
4月前
|
Linux Docker 容器
ip addr命令解析
ip addr命令解析
448 1
|
3月前
|
运维 Rust 监控
Linux高效运维必备:fd命令深度解析,文件描述符管理从此得心应手!
【8月更文挑战第23天】本文介绍了一款名为fd的命令行工具,该工具基于Rust语言开发,旨在以更直观的语法和更快的速度替代传统的`find`命令。通过本文,您可以了解到如何安装fd以及一些基本用法示例,比如使用正则表达式匹配文件名、排除特定目录等。此外,文章还展示了如何结合`ps`和`lsof`命令来查找特定文件并显示其文件描述符,从而帮助您更好地管理和监控Linux系统中的文件与进程。
125 0
|
4月前
|
Linux
《解析 Linux 命令:systemd-delta》
`systemd-delta`: 解析Linux服务配置差异。概览: 显示服务单元文件与默认配置的对比,助于配置问题排查与系统审计。特点: 清晰展示修改点,涵盖启动选项等。示例: `systemd-delta [--plain] <service>`. 注意: 理解默认配置,谨慎修改,定期检查。掌握此命令,深化系统服务配置洞察,优化Linux管理。#Linux #systemd-delta
|
4月前
|
存储 监控 Linux
stdbuf命令在Linux中的深度解析
`stdbuf`是Linux工具,用于控制命令的stdin、stdout和stderr的缓冲模式。它可以设置为无缓冲、行缓冲或块缓冲,以优化数据处理和实时性。例如,`stdbuf -o0 cmd`禁用cmd的输出缓冲,`-oL`则按行缓冲。在需要实时监控或高效处理大量数据时,选择合适的缓冲模式至关重要。注意,过度使用无缓冲可能影响性能,并非所有系统都支持`stdbuf`。

推荐镜像

更多