Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is possible to print the result of 2 commands side by side...

Something like this

something `ls -l /a` `cat bla.txt`


total 24                                                #while [ 1 = 1 ]; do
-rw-r--r-- 1 wolfy wolfy  194 Aug 13 08:50         #       echo "bla"
-rwxr-xr-x 1 wolfy wolfy   52 Sep 24 11:48       #done
-rwxr-xr-x 1 wolfy wolfy   38 Sep 24 11:48      echo "bla"
-rwxr-xr-x 1 wolfy wolfy  147 Sep 24 11:54

I know that pr can do something like this with files, but I didn't find a way to do this for commands...

share|improve this question
up vote 8 down vote accepted

You can use process substitution

pr -m <(cmd1) <(cmd2)

though in your case, since you have one command and one file:

ls -l | pr -m - bla.txt
share|improve this answer
Instead of pr -m one can use paste. – Ramchandra Apte Oct 15 '13 at 15:39
@RamchandraApte yes, though paste won't align them in columns like pr -m does. – geirha Oct 15 '13 at 18:36

You can use screen like this:

In screen type Ctrl-a | for vertical and Ctrl-a S for horizontal split.

  • jump to next display region: Ctrl-a Tab
  • remove current region: Ctrl-a X
  • remove all regions but the current one: Ctrl-a Q

start ls -l /a in the right half and cat bla.txt in the left.

share|improve this answer
Where screen works, tmux works too. – minerz029 Oct 17 '13 at 13:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.