News for hackers. Stuff that matters.
Re:Things you (probably) didn't know about xargs by nuxi on Monday June 27, 2011 @04:25AM (#2700592)
I'll have to run some more tests, but I can't see how -delete would help in that case .
Re:Things you (probably) didn't know about xargs by ars on Monday June 27, 2011 @05:13AM (#2700676)
Because find changes to the directory first (carefully not following symlinks), and then deletes the file from there.

It does not delete the file using the entire path (which may contain a sudden symlink).

It's not possible to do this safely using xargs.

Take a look also at -execdir which does the same thing - changes to the directory first, and runs things from there. -exec is not safe and should not be used.

xargs is not safe if you are running against a directory not your own. You should use find and -execdir instead.

Yes, the original authors of posix made a mistake here.

> Also, rant rant, I really don't understand why find was extended with -delete in the first place.

I'm hoping you understand it now.

Re:Things you (probably) didn't know about xargs by nuxi on Tuesday June 28, 2011 @06:07AM (#2704788)
Yes, thanks for the extensive info.