paste is the complement of cut: instead of splitting columns out of a file, it joins lines from several files with a separator. By default the separator is a tab.
paste names.txt phones.txt # tab-separated columns
paste -d, names.txt phones.txt # comma-separated (make CSV)
paste -s names.txt # turn lines into one tab-separated row
paste -d: /etc/passwd # no-op: already colon-separated
paste is the quickest way to stitch together parallel data: for example, merging two sorted lists into a two-column TSV for further processing.
Related terms: cut, join
Discussed in:
- Chapter 8: Text Processing — Combining and Splitting