horizontally concatenate lines 



paste [-s] [-d list] file ...


paste concatenates lines of all the specified input files onto the standard output. If you specify - instead of a file, paste uses the standard input. Normally, an output line consists of the corresponding lines from all the input files. paste replaces the newline character at the end of each input line (except the one from the last file on the command line) with a tab character, or characters specified by the -d option.


-d list 

specifies a list of characters to be used one at a time instead of the tab character to replace the newline at the end of input lines. paste uses list circularly; when it exhausts the characters in list, it returns to the first character in the list. If you also specify the -s option, paste returns to the first character of list after processing each file. Otherwise, it returns to the first character after each line of output. list may contain any of the following standard C escapes such as \n, \t, \r, \b, \\, and \0, where \0 indicates that no separator is to be used.


concatenates all lines from each input file together on the single output line. If the -s option is not specified and an end-of-file is detected on any (but not all) of the input files, paste behaves as though empty lines have been read from those files.


The command ls | paste -s -d'\t\t\n' displays the output of ls in three tab separated columns.

If file A contains:


and file X contains:


the command paste A X produces:

a	x
b	y
c	z

and the command paste -s A X produces:

a	b	c
x	y	z


Possible exit status values are:


Successful completion.


Failure due to any of the following:

— missing input files
— too many files specified
— inability to open a file

Unknown command line option.

too many files at "name

You specified more files than paste can handle. The name given in the error message is the name of the first file that paste could not open. The number of files that paste can open depends on the number of files that other processes have open.


POSIX.2. x/OPEN Portability Guide 4.0. UNIX System V. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition



PTC MKS Toolkit 10.4 Documentation Build 39.