linux awk的用法
<pre>
[root@iZ23uewresmZ ~]# cat /home/ceshis.txt
b 12 42 30
b 03 43 25
a 08 10 16
m 71 87 998
m7282064
a022021
a061048
m9324822
b103303
a013386
b044525
m8987131
B081016
M45678
B103303
BADc2345 [root@iZ23uewresmZ ~]# cat /home/ceshis.txt | grep 12
b 12 42 30
[root@iZ23uewresmZ ~]# cat /home/ceshis.txt | grep 12 | awk '{print $1}'
b
[root@iZ23uewresmZ ~]#
</pre>
awk '{print $1}' 就是读取第一个字段b awk '{print $2}'读取第二个字段12