IT notes

parallel xargs

To run a script in parallel using xargs: printf %d\\n {0..9} | xargs -n 1 -P8 sleep In this case sleep is going to be call 8 times (-P8) using has the input an int from 0 to 9. From the man: -P maxprocs Parallel mode: run at most maxprocs invocations of utility at once.

pdsh

pdsh - issue commands to groups of hosts in parallel Install: brew install pdsh Usage: pdsh -R ssh -w ^servers.txt "<command>" In where servers.txt is something like: 10.8.4.2 10.8.4.3 10.8.4.4 one-liner: pdsh -b -w "10.8.4.2, 10.8.4.3, 10.8.4.4" "<command>" -b Disable ctrl-C status feature so that a single ctrl-C kills parallel job. (Batch Mode)