当前位置: 首页 > Linux

每天学一个Linux命令(37):paste

时间:2023-04-06 07:06:17 Linux

昨天推荐:每天学一个Linux命令(36):diff命令介绍paste命令用于并排显示多个文件的对应行,以及将多个文件合并成列。语法格式paste[option][file]paste[OPTION][FILE]optiondescription-d#指定分隔符替换默认分隔符(TAB分隔符)-s#串行而不是并行处理--help#显示帮助信息--version#显示版本信息应用示例并排显示两个文件的内容,[root@centos7testdir]#pastemingongge1.txtmingongge2.txt11111111111111111111head122222222222222222222223333333333333?head3444444444444?444?444444444?head41?2?3?4paste命令其他用法[root@centos7?testdir]#?paste?mingongge1.txt1111?11?111111?1?111?1?1?1122222222222?222?2222?22?2?2?233333333333?333333?3333?333?33444444444444?444?4444444441234?#连接文件中的所有行[root@centeros7testdir]#Paste-SMingongge1.txt111111111111111111122222222222222222333333333333333344444444444444444444@centos7?testdir]#?paste?-d,?-s?mingongge1.txt1111?11?111111?1?111?1?1?11,22222222222?222222222222,33333333333333333333333333,444444444444444444444444,1,2,3,4[root@centos7tESTDIR]#Paste-d[]-SMINGONGGE1.TXT11111111111111111[2222222222222222]3333333333333333[444444444444444444444]3testdir]#?paste?-d/?-s?mingongge1.txt1111?11?111111?1?111?1?1?11/22222222222222222222222/33333333333333333333333333/444444444444444444444444/1/2/3/4#查看粘贴命令版本[root@centos7testdir]#paste(GNUcore.Cutil213)#paste(GNU.Cutil213)FreeSoftwareFoundation,Inc.LicenseGPLv3+:GNUGPL版本3或更高版本。这是免费软件:您可以自由更改和重新分发它。没有保证,在法律允许的范围内。由DavidM.Ihnat和DavidMacKenzie撰写。粘贴以合并两个文件,或添加行[root@centos7testdir]#catmingongge1.txt1111111111111111111122222222222222222222222333333333333333333333333334444444444444444444444441234[root@centos7testdir]#catmingongge2.txthead1head2head3head4[root@centos7?testdir]#?paste?-d?'n'?mingongge1.txt?mingongge2.txt1111?11?111111?1?111?1?1?11head122222222222?222?2222?22?2?2?2head233333333333?333333?3333?333?33head3444444444444?444?444444444head41234[root@centos7?testdir]#?paste?-d?'r'?mingongge1.txt?mingongge2.txthead111?111111?1?111?1?1?11head2222222?222?2222?22?2?2?2head3333333?333333?3333?333?33head44444444?444?4444444441234每天学一个Linux命令(34):wc每天学一个Linux命令(35):dos2unix