I'm very well aware, that I can use xargs to run commands in parallel. However since the consoleout of the commands is important I was wondering if I could split the console window similar to how screen allows you to split the console window.

So is there a way I could convert a script like the following to run n parallel while each execution is shown inside it's own console "window"?

for file in directory/*; do
    command1 $file
    command2 args $file ...
  • Do you mean something like xterm -e command1 & xterm -e command2? – dessert Nov 10 '17 at 8:38
  • @dessert no more like this: i.ytimg.com/vi/QtRQmjBA3b8/maxresdefault.jpg But automated. – BrainStone Nov 10 '17 at 8:44
  • askubuntu.com/q/954051/507051 offers two approaches, the second (see the answer's bottom) being to redirect a command's output to another terminal using e.g. command > /dev/pts/1 – maybe this suits your need? – dessert Nov 10 '17 at 9:00
  • @dessert Not quite what I'm looking for. I'd like to just use one console window. So I can also use the split screen over SSH. – BrainStone Nov 10 '17 at 9:08
  • 1
    I have been told screen works fairly well over SSH. – Bananguin Nov 10 '17 at 9:30

Your Answer

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

Browse other questions tagged or ask your own question.