Print the content of two text files side by side
If the content of ~/file-1.txt
is
one
two
three
four
five
… and the content of ~/file-2.txt
is
foo
bar
baz
… then the following command will print their content «side by side»:
$ pr -mt ~/file-1.txt ~/file-2.txt
one foo
two bar
three baz
four
five
Print the output of two programs side by side
The following example prints file in
/tmp
starting with
a
on the left side, files starting with
w
on the right side:
$ pr -mt -w 100 <( ls -1 /tmp/a* ) <( ls -1 /tmp/w* )