Paste command on Linux (combine columns)
The paste command in Linux (paste) is used to concatenate the lines of several files in vertical columns.
Frequently used options are:
- -d’s’: Separate columns with the s symbol in single quotes;
- -s: concatenates the entire content of a file with one line for each file.
Example: Suppose file 1 has the following content:
And file 2 has the following content:
When using the paste command, the result will be as follows:
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it?
Share