阅读背景:

【cut grep sort awk xargs sed】

来源:互联网 
grep

筛选行

参数 含义 -v 反选

以 ifconfig ens33 样例数据为例

[atguigu@hadoop102 ~]$ ifconfig ens33 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10.102 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::20c:29ff:fec3:515e prefixlen 64 scopeid 0x20<link> ether 00:0c:29:c3:51:5e txqueuelen 1000 (Ethernet) RX packets 125370 bytes 17980197 (17.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 952591 bytes 1790545604 (1.6 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [atguigu@hadoop102 ~]$ ifconfig ens33|grep inet inet 192.168.10.102 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::20c:29ff:fec3:515e prefixlen 64 scopeid 0x20<link> [atguigu@hadoop102 ~]$ ifconfig ens33|grep inet|grep -v inet6 inet 192.168.10.102 netmask 255.255.255.0 broadcast 192.168.10.255 cut [atg



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: