O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

$ 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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required