paste
The paste
command is used to paste files together.
FIXTHIS see section 21.18 in the Unix Power Tools book
For instance, if you have two files called myfile1.txt
and myfile2.txt
that have the same number of rows, and the information from each row of the first file corresponds in some way to the information from the analogous row in the second file, you might want to paste the two files together, side by side, like this:
paste myfile1.txt myfile2.txt >mynewfile.txt
This creates mynewfile.txt
with the information from these two files, pasted together, side by side. For instance, the fifth row of mynewfile.txt
contains the information from the fifth row of myfile1.txt
and the fifth row of myfile2.txt
.
FIXTHIS it would be nice to have a motivated example for paste here, rather than just something conceptual and high level.