Skip to content

Latest commit

 

History

History
97 lines (71 loc) · 1.25 KB

File metadata and controls

97 lines (71 loc) · 1.25 KB

paste

merge lines of files


References

  • man paste

Synopsis

paste [OPTION]... [FILE]...
  • Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.
  • With no FILE, or when FILE is -, read standard input.

Options

  • -d, --delimiters=LIST reuse characters from LIST instead of TABs
  • -s, --serial paste one file at a time instead of in parallel

Usage

Sample

$ cat file1
1
2
3

$ cat file2
China
US
UK

$ cat file3
Asia
North America
Europe

Default

$ paste file1 file2 file3
1       China   Asia
2       US      North America
3       UK      Europe

Serial

$ paste -s file1 file2 file3
1       2       3
China   US      UK
Asia    North America   Europe

Delimiter

Single

$ paste -d : file1 file2 file3
1:China:Asia
2:US:North America
3:UK:Europe

$ paste -d'|' file1 file2 file3
1|China|Asia
2|US|North America
3|UK|Europe

Multiple

$ paste -d':|' file1 file2 file3
1:China|Asia
2:US|North America
3:UK|Europe

$ paste -d':|' file1 file2 file3 file1
1:China|Asia:1
2:US|North America:2
3:UK|Europe:3

$ paste -d':||' file1 file2 file3 file1
1:China|Asia|1
2:US|North America|2
3:UK|Europe|3