The unix find(1) utility is very useful allowing me to perform an action on many files that match certain specifications, e.g.
find /dump -type f -name '*.xml' -exec java -jar ProcessFile.jar {} \;
The above might run a script or tool over every XML file in a particular directory.
Let's say my script/program takes a lot of CPU time and I have 8 processors. It would be nice to process up to 8 files at a time.
GNU make allows for parallel job processing with the -j flag but find does not appear to have such functionality. Is there an alternative generic job-scheduling method of approaching this?
-Poption! – PP. Oct 25 '10 at 09:45xargs -P- it has a never-fixed bug of garbling the output (unlikeparallel) whenever 2 threads happen to produce output at same exact moment... – Vlad Jun 10 '19 at 19:19parallelis really superior in this matter and probably exists/popular thanks to that bug, plus the parallel got upgraded to support--line-buffersome years ago, which made it a total blast ;) – Vlad Jun 24 '21 at 04:00