PASTE(1) User Commands PASTE(1)

paste - merge same lines of several files or subsequent lines of one file

paste file1 file2 . . .
paste -dlist file1 file2 . . .
paste -s [-dlist] file1 file2 . . .

The paste command, as shown in the first two synopsis forms, will combine each set of corresponding lines of the given files to one single line, separated by delimiters, a tabulator (\t) character by default. If a file contains fewer lines than others, nothing is printed between the delimiters.

In the third synopsis form, paste serially combines all lines of each file to one single line, separated by delimiters. One line per file results.

If a file is `-', standard input is read.

The paste command accepts the following options:

Sets the delimiter characters. Each single character in list is used in the given order to separate fields (former lines of input). If list is exhausted, or a new set of corresponding lines begins, or (with the -s option) a new file is printed, the sequence is repeated starting at the first character. The following character sequences in list are special:

\n Newline character.
\t Tabulator character.
\\ Backslash character.
\0 No delimiter at all.

Selects the third synopsis form (serial paste).

See locale(7).
Determines the mapping of bytes to characters for the argument of the -d option.

cut(1), locale(7)

4/17/03 Heirloom Toolchest