Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 15:25:54 +0000 (UTC)
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
.
- Follow-Ups:
- Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: Glenn Jackman
- Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- References:
- why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: ewaguespack
- why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Prev by Date: Re: When would you use qr// on a literal string?
- Next by Date: Re: CGI: Running a forked background process
- Previous by thread: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Next by thread: Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Index(es):