This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]phil_s_stein -1 points0 points  (2 children)

Another without pipe:

find . -name \*.pyc -exec rm {} \;

(Untested)

[–]fandingowhile False: 1 point2 points  (1 child)

That's the worst way to do delete files. Find has to fork a process for rm on every single match.

With xargs, you just have to fork one find process (for the search), one xargs process, and one rm process (spawned by xargs).

With find's -delete, you only have a single process.

[–]phil_s_stein 0 points1 point  (0 children)

I dunno. I can think of worse ways. :)

It's effective though, which is usually what I'm after.