Sunday, December 22, 2013

Paste Command Examples in Linux

Linux Paste Command Examples

Command: paste

Command Usage: merge lines of filesCommand Syntax: $ paste [OPTION]... [FILE]...

Examples for Paste Command:

1. To print options and info of this command

    $ paste --help

2. To paste two files f1.txt and f2.txt

    $ cat  f1.txt
    a
    b
    c

    $ cat f2.txt

    1
    2
    3

    $ paste f1.txt f2.txt

    a  1
    b  2
    c  3

 3. To paste two files f1.txt and f2.txt with delimiters -d and
     serial -s

     $ paste -s -d : f1.txt f2.txt

     $ paste -s -d : f1.txt f2.txt

     a:b:c
     1:2:3


Paste Command Examples in Linux

No comments:

Post a Comment

Linux Tips and tricks,Online Linux Helpers