A few notes on find's exec(jpospisil.com)2 points·by _zkog·3 ปีที่แล้ว·1 commentsjpospisil.comA few notes on find's exechttps://jpospisil.com/2024/01/02/a-few-notes-on-finds-exec1 commentsPost comment[–]theamk·3 ปีที่แล้วreplyinteresting trick, but note that many tools ("file" included) can process multiple files at once. So the example could be rewritten using find+xargs as: find /usr/lib -name "*.so" -print0 | xargs -0 file -N --mime-type | egrep ": text/plain$" this is much faster (0.5 sec vs 8 sec on my PC), easily parallelizeable if needed, and requires fewer tricks to keep arguments quoted.
this is much faster (0.5 sec vs 8 sec on my PC), easily parallelizeable if needed, and requires fewer tricks to keep arguments quoted.