linux 按行分割文件
程序员文章站
2022-04-28 21:22:21
$ sudo awk 'NR%2==1{close(p".txt");++p}{print > p".txt"}' test.txt $ sudo split -d -l 2 test.txt new ......
$ sudo awk 'nr%2==1{close(p".txt");++p}{print > p".txt"}' test.txt
$ sudo split -d -l 2 test.txt new