Name
paste
Synopsis
paste [options
]files
Merge corresponding lines of one or more files into vertical columns, separated by a tab. See also cut, join, and pr.
Options
-
-
Replace a filename with the standard input.
-d
char
,--delimiters=
char
Separate columns with char instead of a tab. char can be any regular character or the following escape sequences:
|
Newline |
|
Tab |
|
Backslash |
|
Empty string |
Note: you can separate columns with different characters by supplying more than one char.
-s
,--serial
Merge subsequent lines from one file.
Examples
Create a three-column result file results from the files in1.data, in2.data, and in3.data:
paste in1.data in2.data in3.data > results
List users in two columns:
who | paste - -
Merge each pair of lines into one line:
paste -s -d"\t\n" list
Get Unix in a Nutshell, 4th Edition 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.