Paste - Ubuntu Linux program

Revision as of 17:28, 10 October 2019 by Ardaut (talk | changes)

The command paste - (which is similar to cat) - outputs the input files largely unchanged to the standard output, but does not simply hang them one after the other, but combines lines of input column by column.

There are two modes of operation: All lines of the input files with the same line number are combined to one line of the output and separated with one character each.
All lines of an output file are combined to a single line of output (again with a separator) before the next file is output.

The default separator is a tab.

Example:

paste <(seq 1 5) <(seq 11 15) <(seq 21 25)
    1 11 21
    2 12 22
    3 13 23
    4 14 24
    5 15 25


paste -s <(seq 1 5) <(seq 11 15) <(seq 21 25)
1       2       3       4       5
11      12      13      14      15
21      22      23      24      25