Linux common basic commands (paste)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.