tldr/pages/common/paste.md

24 lines
556 B
Markdown
Raw Normal View History

2015-12-30 03:41:32 +00:00
# paste
> Merge lines of files.
- Join all the lines into a single line, using TAB as delimiter:
2015-12-30 03:41:32 +00:00
`paste -s {{file}}`
- Join all the lines into a single line, using the specified delimiter:
2015-12-30 03:41:32 +00:00
`paste -s -d {{delimiter}} {{file}}`
- Merge two files side by side, each in its column, using TAB as delimiter:
2015-12-30 03:41:32 +00:00
`paste {{file1}} {{file2}}`
- Merge two files side by side, each in its column, using the specified delimiter:
2015-12-30 03:41:32 +00:00
`paste -d {{delimiter}} {{file1}} {{file2}}`
- Merge two files, with lines added alternatively:
2015-12-30 03:41:32 +00:00
`paste -d '\n' {{file1}} {{file2}}`