Linux paste command

Updated: 05/04/2019 by Computer Hope
paste command

On Unix-like operating systems, the paste command displays corresponding lines of multiple files side-by-side.

This page covers the GNU/Linux version of paste.

Description

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.

Syntax

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

Options

-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.

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.