parallel
A nice overview
parallel execution of command on each txt file
parallel commmand {} ::: *.txt
Track slot number % and job number #
> parallel echo {%} {#} {} ::: *.txt
1 1 foo.txt
2 2 fee.txt
1 3 fi.txt
2 4 fum.txt
Manage max slots with -j
Slots default to the number of available processors
> parallel -j 1 echo {} ::: *.txt
1 1 foo.txt
1 2 fee.txt
1 3 fi.txt
1 4 fum.txt
Check for correctness using --dryrun
parallel --dryrun echo {} ::: *.txt
> parallel echo {} ::: **/*
a.txt
b.txt
subdir/c.txt
subdir/d.txt
> parallel echo {.} ::: **/*
a
b
subdir/c
subdir/d
> parallel echo {/} ::: **/*
a.txt
b.txt
c.txt
d.txt
> parallel echo {/.} ::: **/*
a
b
c
d
> parallel echo {//} ::: **/*
.
.
subdir
subdir