cat compare.txt | awk '{print $2}’
对compare.txt 的每一行执行print $2, $2表示的是第二个字段
示例:
-sh-4.1$ cat kenny.txt 11 22 33 44 55 66 -sh-4.1$ cat kenny.txt | awk '{print $2}' 22 55 -sh-4.1$ cat kenny.txt | awk '{print $3}' 33 66