原文:https://blog.csdn.net/xuduorui/article/details/81322115
awk if 使用方法
例如筛选tcp中接受或发送的有堆积的链接情况:
$ netstat -tanp | awk '{if ($2 > 0 || $3 > 0) print $0}'
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 36 172.17.1.12:1229 11.19.14.15:8763 ESTABLISHED 29280/sshd: root@pt
1
2
3
4
awk中的if的比较符使用C比较符号。
---------------------
作者:uxff
来源:CSDN
原文:https://blog.csdn.net/xuduorui/article/details/81322115
版权声明:本文为博主原创文章,转载请附上博文链接!