Celeb Glow
general | March 28, 2026

How to get the output of two cat commands parallel to each other

If I run cat file1.txt, I have:

linux mint
ubuntu
cent-os
fedora
debian
kali linux
arch linux
kubuntu
open suse
deepin
parrot os

Then cat file2.txt gives:

linux mint
cent-os
fedora
kali linux
arch linux
kubuntu
open
deepin
parrot
ubuntu
debian

But what if I want to make output like this?

file1.txt file2.txt
linux mint linux mint
ubuntu cent-os
cent-os fedora
fedora kali linux
debian arch linux
kali linux kubuntu
arch linux open
kubuntu deepin
open suse parrot
deepin ubuntu
parrot os debian
1

2 Answers

What you need is paste commad which paste rows in files side by side:

paste file1.txt file2.txt

This outputs exactly what you wanted.

For more options check man paste.

1

pr will do what you want when used like so:

pr -mt file1.txt file2.txt
  • -m will print all files in parallel.
  • -t will omit page headers and trailers.

Example output:

linux mint linux mint
ubuntu cent-os
cent-os fedora
fedora kali linux
debian arch linux
kali linux kubuntu
arch linux open
kubuntu deepin
open suse parrot
deepin ubuntu
parrot os debian

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy