页次: 1
linux 中 paste 命令用来进行行的合并,
-s:默认是每个文件中的一个行, 合并成新的一行, -s命令合并后是两行(不管源文件有几行,合并都是一行, 一个文件一行)。
-d: 设置新的分割域
示例代码
cat b.txt this is another one this is another two [root@qd ~]# paste a.txt b.txt this is one this is another one this is two this is another two [root@qd ~]# paste -s a.txt b.txt this is one this is two this is another one this is another two
-d: 选项d默认的是水平制表符
比如用 #
paste -s -d# a.txt b.txt this is one#this is two this is another one#this is another two#
最后多个了 # 是因为 b.txt 有个空行
ipbbs.net
离线
页次: 1