Run a command in parallel using xargs
. In the following example, -n 1
specifies that one argument from the input should be used for each command, -P 5
specifies the max number of parallel processes, and urls.txt contains a line delimited list of URLs to use as arguments for each run of COMMAND
:
cat urls.txt | xargs -n 1 -P 5 COMMAND