3 ms·
> I'm curious why you (or anyone) uses -exec? I already know how to use it. It works. > It's often painfully slower than piping through xargs I've tried it.
by josteink 9y ago
> I'm curious why you (or anyone) uses -exec?
I already know how to use it. It works.
> It's often painfully slower than piping through xargs
I've tried it. It has different semantics. First attempt always leads to errors and doing the wrong things. I always have to come up with some workaround to make things work as I expect they would (i.e. how -exec does things by default).
This lack of confidence also means I would never dare using xargs for anything remotely destructive (like rm).
What reason do I have not to use -exec? Why swap a perfectly perfect hammer for a broken screwdriver?
Besides: IMO the timesaving aspects of find is not strictly tied to how fast find runs. It's tied to what I can automate.