That's too slow. Using xargs is faster, or if your version of find supports it, change the "\;" at the end to a "+".
–
Dennis WilliamsonSep 7 '09 at 12:11

1

It may be a little slower--it runs "rm" once for each file instead of batching them--but it's the most portable way to do it. The OP didn't say what kind of unix he was using, and Solaris find still doesn't have the -print0 feature.
–
KensterSep 7 '09 at 13:49

1

+1, OP said unix not linux, this is the best portable solution.
–
theotherreceiveSep 7 '09 at 13:59

I think this solution is the only permitting to remove tons of files, if I am not wrong using xargs can leave into a command line too long error. +1, it is my choice since years too.
–
AlberTSep 7 '09 at 15:23

If you are using a makefile to build your project, you might want to add this in to the target "clean".
–
Tom NewtonSep 7 '09 at 16:01