awk 简单使用

参考链接

awk '$1>2 {print $1,$2}' test.txt # 第一行大于2
awk '$1==2 {print $1,$2}' test.txt
awk '$1==2 {print $0}' test.txt # 输出全部文本
awk '$2 ~ /th/ {print $0}' test.txt # ~ 表示模式开始。// 中是模式
awk '$2 !~ /th/ {print $0}' test.txt # 取反
awk 'BEGIN{IGNORECASE=1} /this/' test.txt

猜你喜欢

转载自blog.csdn.net/qq_17612199/article/details/80354739
今日推荐