Name

paste — stdin  stdout  - file  -- opt  --help  --version

Synopsis

paste [options] [files]

The paste command is the opposite of cut: it treats several files as vertical columns and combines them on standard output, effectively pasting them side by side:

cat letters
A
B
C
➜ cat numbers
1
2
3
4
5
➜ paste numbers letters
1  A
2  B
3  C
4
5
➜ paste letters numbers
A  1
B  2
C  3
   4
   5

Useful options

-d delimiters

Use the given delimiters characters between columns; the default is a Tab character. Provide a single character (-d:) to be used always, or a list of characters (-dxyz) to be applied in sequence on each line (the first delimiter is x, then y, then z, then x, then y, …).

-s

Transpose the rows and columns of output:

paste -s letters numbers
A   B   C
1   2   3   4   5

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.