天天看點

awk 字段比對

[[email protected] ~]$ cat aa
dd 99
dd9 88
ee 88
ff dd
[[email protected] ~]$  awk  '{if ($1=="dd") print $0}' aa
dd 99
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$  awk  '{if ($1=="dd") print $0}' aa
dd 99
[[email protected] ~]$  awk  '{if ($1~/dd/) print $0}' aa
dd 99
dd9 88