Linux-paste文件合并

7.Shell

本章同步视频:https://edu.51cto.com/sd/e4874

3.paste - merge lines of fileside

(1)语法spa

[dmtsai@study ~]$ paste [-d] file1 file2orm

选项与参数:视频

-d  :后面能够接分隔字符。预设是以 [tab] 来分隔的!get

-   :若是 file 部分写成 - ,表示来自 standard input 的资料的意思。input

(2)用法同步

[root@localhost tmp]# paste join1 join2it

adm:x:3:4:adm adm:x:4:ast

bin:x:1:1:bin bin:x:1:class

daemon:x:2:2:daemon daemon:x:2:

lp:x:4:7:lp root:x:0:

root:x:0:0:root sys:x:3:

[root@localhost tmp]# paste -d : join1 join2

adm:x:3:4:adm:adm:x:4:

bin:x:1:1:bin:bin:x:1:

daemon:x:2:2:daemon:daemon:x:2:

lp:x:4:7:lp:root:x:0:

root:x:0:0:root:sys:x:3:

[root@localhost tmp]# paste -s -d: join1 join2

adm:x:3:4:adm:bin:x:1:1:bin:daemon:x:2:2:daemon:lp:x:4:7:lp:root:x:0:0:root

adm:x:4::bin:x:1::daemon:x:2::root:x:0::sys:x:3:

本章同步视频:https://edu.51cto.com/sd/e4874

相关文章
相关标签/搜索