Paste (Unix)

paste
Original author(s)AT&T Bell Labs
Developer(s)GNU Project
Initial release1973 (as part of Version 4 Unix)
Written inC
Operating systemUnix, Unix-like (Linux, macOS)
PlatformPOSIX-compliant systems, Cross-platform
TypeCommand-line utility
Licensecoreutils: GPL v3+
WebsiteGNU manual

paste is a shell command that joins files horizontally (parallel merging) by writing to standard output lines consisting of the sequentially corresponding lines of each input file, separated by tabs.

The command reads each specified input file line-by-line. For each set of input lines, the command outputs a line formatted as the concatenation of the input files' lines separated by a tab character. If the content of a file runs out, the command will use an empty string for the file. As such, the number of output lines will equal the number of lines of the file with the most lines. Some implementations support using a fixed string (such as "NA") when a files content is exhausted before the others.

A sequence of empty records at the bottom of a column of the output stream may or may not have been present in the input file corresponding to that column as explicit empty records, unless you know the input file supplied all rows explicitly (e.g. in the canonical case where all input files all do indeed have the same number of lines).

The command accepts the following options:

-d|--delimiters delimiters, specifies a list of delimiters to use instead of tabs for separating consecutive values on a single line. Each delimiter is used in turn, and when the list has been exhausted, paste begins again at the first delimiter.
-s|--serial, select to append in serial rather than in parallel; that is, horizontal rather than vertical.

The command was developed for Unix at Bell Labs by Gottfried W. R. Luderer.[1][2] The implementation bundled in GNU coreutils was written by David M. Ihnat and David MacKenzie.[3] The command is available for Windows via UnxUtils.[4]

  1. ^ "paste(1) - OpenBSD manual pages".
  2. ^ "[TUHS] A portrait of cut(1)".
  3. ^ "Paste(1): Merge lines of files - Linux man page".
  4. ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search