[nflug] rm Limitations

Robert Meyer meyer_rm at yahoo.com
Mon Jun 23 14:54:53 EDT 2008


Hmmm... how many ways to do this... If you can't think of at least three, you're not thinking hard enough :-)

find . -type f | perl -ne 'chop; unlink;'

Cheers!

Bob

 --
"When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return."
--Leonardo da Vinci



----- Original Message ----
From: Joshua Johnson <joshpauljohnson at gmail.com>
To: nflug at nflug.org
Sent: Monday, June 23, 2008 2:37:52 PM
Subject: Re: [nflug] rm Limitations

Either rm the whole directory or (like Frank said) iterate through them:

for file in `ls`; do rm -f "$file"; done

This has been a discussion on here before and there are faster ways to do this. They escape me right now. The problem is that there is a limit to how many arguments you can give on the command line.


On Mon, Jun 23, 2008 at 2:22 PM, Franklin Kumro Jr <fkumro at gmail.com> wrote:

Iterate over the dir listing and rm each file

Should work!

-Frank


On Mon, Jun 23, 2008 at 10:42 AM, Robert Wolfe <robertwolfe at localnet.com> wrote:
> Hi all!
>
> I have a BUNCH of files I need to clean out of a directory, but when I execute 'rm *' I get an "Argument list too long" error message.  Is there a way around this?  I get the same when mv'ing or cp'ing to /dev/null as well.
>
> --
> Robert Wolfe <robertwolfe at localnet.com>
>
> "The only good thing about Vista is that even
>  the viruses have compatibility issues. "
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>



--
Frank
Shenanigans!!
I do the voodoo that I do do with sudo!

_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nflug.org/pipermail/nflug/attachments/20080623/9c588785/attachment-0001.html


More information about the nflug mailing list