Is there some mechanism to make find with -exec use multiple jobs?
Lets use this command for example
find ./* -exec flac --best {} \;
Is there some way to set the number of concurrent -exec
commands to run easier than something like this solution:
run find ./*
and save the results to a file/pipe them for another command to split into 16 parts (or however many threads you want) then run commands on these?
-P
– muru Sep 2 '19 at 1:40find ./* -type f -print0|xargs -0 -P 16 -I % opusenc --bitrate 256 % %.opus
– SultanLegend Sep 2 '19 at 3:52./*
. A dot would be enough, and that would not blow up if you have many names in the current directory. I would also suggest a-name
test to get names you want and not everything (and-type f
to avoid runningflac
(oropusenc
) on directories). If you have one single directory, you shouldn't needfind
at all, and if you're usingbash
orzsh
, you could use**
instead offind
. – Kusalananda♦ Sep 2 '19 at 6:57