Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含六列的文件,我只想打印第六列中值 >3 的行的前两列。
此语句打印第六列 > 3 的所有行
awk '$6 > 3' file > out
此语句打印前两列:
awk '{print $1,$2}' file > out
任何人都知道如何将这两个命令组合成一条线?
你快到了,就像你说的,“结合他们”!. 试试这个:
awk '$6>3{print $1,$2}' file >out