I have already written about how to run execute commands on multiple Linux or UNIX Servers. Now Joe ‘Zonker’ Brockmeier show us how to use xjobs utility to run multiple jobs out of multiprocessor machine :)
From the article:
Ever feel like you’re not getting the most out of your multiprocessor machine? The xjobs utility allows you to schedule several processes to run simultaneously to make the most of your system’s resources.
Xjobs takes a list of arguments from standard input and passes them to a utility, or takes a list of commands from a script, and then runs the jobs in parallel. If you have a multiprocessor machine, xjobs will automatically run one job per processor by default. For instance, on a dual-CPU machine, if you run ls -1 *gz | xjobs gunzip, xjobs will gunzip two files at a time by default. If you run the same command on a quad-CPU machine, it will gunzip four files at a time by default, until it runs out of files to process.
This is an excellent command for my dual core dual chip AMD box.