awk 简单说明

本文章为个人备忘录使用,非常不详细,不建议作为参考。

输出指定行:

awk '{print $1, $4}' netstat.txt

格式化:

awk '{printf "%-8s %-8s %-8s %-18s %-22s %-15s\n",$1,$2,$3,$4,$5,$6}' netstat.txt

过滤条件:

awk '$3==0 && $6=="LISTEN"' netstat.txt

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注