Paste (Unix)

From Wikipedia, the free encyclopedia

The correct title of this article is paste (Unix). The initial letter is shown capitalized due to technical restrictions.

paste is a Unix utility tool which is used to join files horizontally (parallel merging), e.g. to join two similar length files which are comma delimited. It is effectively the horizontal equivalent to the utility cat command which operates on the vertical plane of two (or more) files, i.e. by adding one file to another in order.

[edit] Example

To paste several columns of data together, enter:

    paste who where when > www

This creates a file named www that contains the data from the names file in one column, the places file in another, and the dates file in a third. If the names, places, and dates file look like:

    who             where           when
    Sam             Detroit         January 3
    Dave            Edgewood        February 4
    Sue             Tampa           March 19 

then the www file will contain:

    Sam             Detroit         January 3
    Dave            Edgewood        February 4
    Sue             Tampa           March 19

[edit] See also