File Viewing & Editing

paste

Merge lines of files side by side, separated by tabs.

Synopsis

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

Examples

Merge two files side by side with tabs
paste names.txt scores.txt
Merge with comma delimiter
paste -d',' file1.txt file2.txt
Join all lines with + separator
paste -s -d'+' numbers.txt
Arrange into 4 columns
seq 10 | paste - - - -

Common options

FlagDescription
-dUse specified delimiter instead of tab
-sPaste one file at a time instead of in parallel
-zUse NUL as line delimiter

About paste

The `paste` command merge lines of files side by side, separated by tabs. Text viewing and editing commands are fundamental tools in any Linux user's toolkit.

Linux treats almost everything as a file, so the ability to quickly inspect, filter, transform, and edit file contents from the command line is critical. These commands are regularly combined with pipes and redirects to build powerful data-processing pipelines.

The command accepts 3 commonly used flags shown above, though the full set of options is available in the man page (`man paste`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Viewing & Editing Commands

Other commands in the File Viewing & Editing category

Related tools