Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?



ewaguespack@xxxxxxxxx wrote in news:1153149395.583924.157680@
35g2000cwc.googlegroups.com:

i had a situation that required that i remove several thousand zero
byte files, and i tried this first:

# find . -type f -exec rm -f {} \;

This executes rm separately for each file found.

this was taking ages, so on a hunch I decided to try this to see it I
got any better results:

# perl -e 'unlink(glob("*"))'

surprisingly the perl unlink took about a quarter of a second to remove
1000 files versus 30 seconds with find / rm

How about

rm -f *

?

Sinan
.