Run commands parallel

Bash shell is the common linux command language.
Post Reply
Posts: 193
Joined: Thu Mar 04, 2010 9:19 pm

Run commands parallel

Post by mister_v »


Is it possible to run 2 commands parallel ?
I have 2 command that take some time to complete.
But i don want to wait until the first command is complete before starting the second one.
Site Admin
Posts: 198
Joined: Mon Jul 21, 2008 9:52 am

Re: Run commands parallel

Post by chris »

You can send a task to the background,
with &. (and symbol)

Code: Select all

#command to the background
ls -la /home &

#get the process id

#wait for it to finish
wait $P1;
Post Reply