linux 中paste命令结合管道时调整合并方向

发布时间 2023-10-31 21:52:05作者: 小鲨鱼2018

 

001、

[root@pc1 test]# ls           ## 两个测试文件
a.txt  b.txt
[root@pc1 test]# cat a.txt
01      02      03      04
05      06      07      08
09      10      11      12
[root@pc1 test]# cat b.txt
a
b
c
[root@pc1 test]# cut -f 2 a.txt | paste - b.txt       ## 管道流在前
02      a
06      b
10      c
[root@pc1 test]# cut -f 2 a.txt | paste b.txt -       ## 管道流在后
a       02
b       06
c       10

。