On 07/19/2014 05:20 AM, Peng Yu wrote: > I'm wondering if there is a faster version of `find` (may be in other > languages, such as python or perl). > > `-exec` of `find` calls for an external command, which is slow.
What exactly is slow with -exec? Please post examples. It's very likely that it's a confusion on your side how find(1) works with -exec. Especially note that an invocation like find some/where -exec some/prog '{}' \; will execute 1 "some/prog" process per file found, while find some/where -exec some/prog '{}' + will execute "some/prog" processes with as much files as parameters as possible by the current environment, thus dramatically reducing the need to spawn new processes. E.g. $ find . -exec echo process '{}' \; process . process ./c process ./b process ./a versus $ find . -exec echo process '{}' + process . ./c ./b ./a Did you hit this one? Have a nice day, Berny