tldr/pages/common/paste.md

25 lines
624 B
Markdown
Raw Normal View History

2015-12-30 03:41:32 +00:00
# paste
> Merge lines of files.
> More information: <https://www.gnu.org/software/coreutils/paste>.
2015-12-30 03:41:32 +00:00
- 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}}`