linux command “paste” with example

Written By Smart| 9 October 2009| One Comment

paste : Using paste you can merge lines of files.

example :

think that you have two text files example1.txt and example2.txt

in example1.txt which contents

admin@smartproteam~$cat example1.txt
the man
wat man
you the man
man the man
man says to ma:wq

in example2 test file

admin@msartproteam~$cat example2.txt
whazzz you
12
223
1
12
433
4433

now you will run paste command

admin@smartproteam~$paste example1.txt example2.txt
the man whazzz you
wat man 12
you the man     223
man the man     1
man says to ma:wq       12
433
4433

using

-d, –delimiters=LIST
reuse characters from LIST instead of TABs

-s, –serial
paste one file at a time instead of in parallel

admin@smartproteam~$paste -s -d:example1.txt example2.txt
whazzz you:12e223×1a12m433p4433

Related Posts with Thumbnails

Share With Others

One Comment »

  • saurabh said:

    Spelling mistake = “Uisng”.
    Thanks

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.