Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: Glenn Jackman <glennj@xxxxxx>
- Date: 17 Jul 2006 15:38:51 GMT
At 2006-07-17 11:25AM, A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx> wrote:
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.
Additionally, 'find' is descending into subdirectories.
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 *
These solutions look in the current directory only.
--
Glenn Jackman
Ulterior Designer
.
- Follow-Ups:
- References:
- why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: ewaguespack
- Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- From: A. Sinan Unur
- why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Prev by Date: Re: A subroutine for gcd
- Next by Date: Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Previous by thread: Re: 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):