Linux paste command

Updated: 04/26/2017 by Computer Hope

About paste

The paste command displays the corresponding lines of multiple files side-by-side.


paste writes lines consisting of the sequentially corresponding lines from each FILE, separated by tabs, to the standard output. With no FILE, or when FILE is a dash ("-"), paste reads from standard input.

paste syntax

paste [OPTION]... [FILE]...


-d, --delimiters=LIST Reuse characters from LIST instead of tabs.
-s, --serial Paste one file at a time instead of in parallel.
--help Display a help message, and exit.
--version Display version information, and exit.

paste examples

paste file1.txt file2.txt

This command would display the contents of file1.txt and file2.txt, side-by-side, with the corresponding lines of each file separated by a tab.

cat — Output the contents of a file.
diff — Identify the differences between two files.
merge — Performs a merge of the contents of three files.
sdiff — Compare two files, side-by-side.