-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Ultimate Linux Shell Scripting Guide
By :

Instead of joining two or more files together end-to-end as cat
does, paste
joins them together side-by-side. This is handy when you have two or more files of columnar data, and you want to look at all of the data in one display. Go ahead and create the two text files that you see in the following diagram Then try out the paste
command that you see in the diagram.
Figure 6.5: Pasting two files together with paste
There are two options that you can use with paste
. The serial option, set with the -s
switch, allows you to view the columns of data horizontally. Pasting the myfile_1.txt
and myfile_2.txt
with the -s
option looks like this:
[donnie@fedora ~]$ paste -s myfile_1.txt myfile_2.txt
one three five seven nine
two four six eight ten
[donnie@fedora ~]$
The delimiter option, set by the -d
switch, allows you to change how the columns are separated. If you leave out the -d
switch, the columns of the pasted display will be separated by tabs, as you see...