更新时间:2023-11-27 15:44:22
此awk
应该做的
awk '/ct/' file1 > file2
如果位置很重要
awk '$3=="ct"' file1 > file2
awk '$3~/ct/' file1 > file2
如果ct
是字段#3中的某些内容的一部分,则
最新版本没问题
last version is ok if ct
is part of some in field #3
与grep
grep ct file1 > file2
不需要
-n
,因为它会打印行号
-n
is not needed, since it prints line number
与sed
sed -n '/ct/p' file1 > file2