rm

hi,

I am trying to delete files using script:-

find . -name "*.xml" | xargs rm *

but i am getting an error "/usr/bin/xargs: Arg list too long"

Could you please help me out with this, or if it could be done using for or while loop.....please help:(...........Thanks in advance!!!

you could use something like:

find . -name "*.xml" | while read temp_file
do
rm $temp_file
done

don't pipe to rm *! This will remove everything in the current directory!

try this

find . -name "*.xml" |xargs rm

or

find . -name "*.xml" -exec rm {}  \;