[nflug] rm Limitations

Mark Musone mmusone at shatterit.com
Tue Jun 24 23:51:35 EDT 2008


You want/need to use the command: xargs

It's made to pass individual arguments to a program t resolve the "too many arguments" problem.

Mark

-----Original Message-----
From: nflug-bounces at nflug.org [mailto:nflug-bounces at nflug.org] On Behalf Of Robert Wolfe
Sent: Tuesday, June 24, 2008 1:04 AM
To: nflug at nflug.org
Subject: RE: [nflug] rm Limitations

One thing - be sure you are in the CORRECT directory before you do this!!!

________________________________________
From: nflug-bounces at nflug.org [mailto:nflug-bounces at nflug.org] On Behalf Of
Joshua Johnson
Sent: Monday, June 23, 2008 2:38 PM
To: nflug at nflug.org
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


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


No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.4.1/1516 - Release Date: 6/24/2008 7:53 AM



More information about the nflug mailing list