186 B
186 B
- 获取比较两个文件的相同行
awk 'NR==FNR{a[$1]++} NR!=FNR{if($1 in a){print}}' text1.txt text2.txt
- 打印行数大于n的内容
awk 'NR >= n' filename
awk 'NR==FNR{a[$1]++} NR!=FNR{if($1 in a){print}}' text1.txt text2.txt
awk 'NR >= n' filename