Paste command
Role: Merging Files
Format:
paste [option] [file]
1, merge the contents of two files, by row
[Email protected]:~/linux/paste$lsghostwu1.txt ghostwu2.txt[email protected]:~/linux/paste$CatGhostwu1.txt123456[email protected]:~/linux/paste$Catghostwu2.txt Hihellonihao Hello, how is youfine think You[email protected]:~/linux/paste$ paste Ghostwu1.txt ghostwu2.txt1Hi2Hello3Nihao4Hello, how is it?5Fine Think you6[email protected]:~/linux/paste$
-D Specify delimiter
[Email protected]:~/linux/paste$ paste-1: Hi2: Hello3: Nihao4: Hello: How is You5: Fine think6:
-S consumes one row per file
[Email protected]:~/linux/paste$ Paste-s Ghostwu1.txt1 2 3 4 5 6[email protected]:~/linux/paste$ Paste-s ghostwu2.txt hi Hello nihao Hello how is you fine think You[email protected]:~/linux/paste$ Paste-s Ghostwu1.txt ghostwu2.txt1 2 3 4 5 6hi Hello nihao Hello how is fine think you
The odd and even line of a file, with the = sign will be a newline symbol to connect
Cat account.txt helloabc123hello2haha123babybaby123[email protected]: ' =\n ' account.txt > account2.txt[email protected]:cat account2.txt Hello= Abc123hello2=Haha123baby=baby123
Linux common basic commands (paste)