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