Run tasks in parallel with xargs
xargs provided a very simple to parallel tasks, e.g. setting P=3 means run 3 processes in parallel
seq 1 10 | xargs -n 1 -P 3 echo
Try to run the command several times, you might notice that number's order might be changed.
Why? Since they are running in parallel and some numbers finished first and some later!