To add to what jbar suggests, it's even better to write:

find -name '*.c' -print0 | xargs -0 rm

Doing it this way should be even safer since names may have new lines in them (almost never in reality, but it's possible).

I would also suggest adding an echo before rm or any other command you run in this way, so you can see what's going to be done before doing it:

find -name '*.c' -print0 | xargs -0 echo rm

Reply via email to