shntnu
1/9/2017 - 2:41 PM

Using xargs to parallelize

Using xargs to parallelize

# -P max-procs
#   Run up to max-procs processes at a time; the default is 1.  
#   If max-procs is 0, xargs will run as many processes as possible 
#   at a time.  Use the -n option with -P; otherwise chances are 
#   that only one exec will be done.

seq 10 | xargs -P 28 -I % echo %
#> 8
#> 4
#> 1
#> 7
#> 6
#> 3
#> 2
#> 5
#> 9
#> 10