linux文件拼接命令 paste

paste [文件名1 [文件名2] ……] [选项]

-s  把文件以行的方式拼接

-d  制定分隔符,默认以制表符分隔

[root@dagege ~]# seq 5 >1.txt
[root@dagege ~]# seq 6 10 >2.txt
[root@dagege ~]# seq 11 15 >3.txt
[root@dagege ~]# paste 1.txt 2.txt 3.txt 
1    6    11
2    7    12
3    8    13
4    9    14
5    10    15
[root@dagege ~]# paste -d ',' 1.txt 2.txt 3.txt 
1,6,11
2,7,12
3,8,13
4,9,14
5,10,15
[root@dagege ~]# paste -d ',' -s 1.txt 2.txt 3.txt 
1,2,3,4,5
6,7,8,9,10
11,12,13,14,15
原文地址:https://www.cnblogs.com/dagege/p/6223890.html