PASTE(1) General Commands Manual PASTE(1)

pastemerge lines

paste [-z] [-d elimiters] [file]…
paste -s [-z] [-d elimiters] [file]…

Without -s, concatenates consecutive lines of files (standard input stream if "-", the default), separating them with tabs, until all are exhausted; otherwise concatenates each file in turn.

, --serial
Concatenate the entirety of each file in turn.
, --zero-terminated
Input and output lines are terminated by NULs, not newlines.
, --delimiters=list
A list of delimiters to use instead of the tab, used circularly for each output line.

Each character corresponds to itself as a delimiter, except the following escapes are recognised:

, \t, \n, , ,
The backspace, tab, line feed, vertical tab, form feed, and carriage return characters, respectively.
\\
Backslash.
The empty string.
\anything
anything

Defaults to "\t". Empty list is equivalent to "\0". Characters is parsed according to the current locale; invalid multi-byte sequences are ignored.

if a file couldn't be opened.

List directory in four columns:

$ ls | paste - - - -
a       a.c     a.cpp   a.out
fips151-1.pdf   paste   paste.1 paste.cpp
paste.o paste.ps

Combine pairs of lines:

$ seq 10 | paste -sd '\t\n' -
1       2
3       4
5       6
7       8
9       10

Conforms to IEEE Std 1003.1-2008 (“POSIX.1”). -z, allowing no files, -d escapes other than \n, \t, \0, and \\, and empty delimiters are extensions, also present on the GNU system.

Appeared, fully formed, as paste(1):

paste - merge same lines of several files or subsequent lines of a file
in CB-UNIX, later part of AT&T System III UNIX, written by Gottfried W. R. Luderer, in-or-before November of 1978. The implementation notes:
/* paste: concatenate corresponding lines of each file in parallel(GWRL) */
/*      (-s option: serial concatenation like old (127's) paste command */
but no evidence of a paste from 127 (AT&T's Computer Science Research division) exists in earlier systems.

It was standardised verbatim in IEEE Std 1003.2-1992 (“POSIX.2”), and appears in 4.3BSD-Reno.

December 3, 2022 voreutils pre-v0.0.0-latest