Back to the command reference

paste

FilesFundamentals In simulator In real Linux

Merge lines of files side by side

Name: paste: paste lines together

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

paste joins corresponding lines of several files with tabs (or the -d delimiter), placing the files side by side as columns. -s joins all lines of one file into a single line instead.

Syntax

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

Common options

-d / --delimiters LISTDelimiter between columns
-s / --serialJoin all lines of each file into one

Examples

  • $ paste names.txt scores.txt

    Put two files side by side

    Explain
  • $ paste -sd, list.txt

    Join lines into one comma-separated line

    Explain

Related