Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

Something like this

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

result:

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

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

2 Answers 2

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
1  
@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

 
discard

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.