On Mon, 2007-03-19 at 15:36 -0600, Nathan wrote:
> You can also use a bash for loop:
> 
> for myfile in *.txt ; do rm "$myfile" ; done

or:

find *.txt | while read f; do rm "$f" ; done

That avoids the problem of the commandline being too long (shell
expansion will sometimes cause your command to fail if there are too
many files.

Michael


> 
> Putting $myfile in quotes ougt to prevent that "spaces in filename"
> problem that Kimball mentioned.
> 
> ~ Nathan
> 
> On 3/19/07, Eduardo Sanz-Garcia <[EMAIL PROTECTED]> wrote:
> > Today I have tried to remove 3500 files at once using the argument
> > expantion of bash: "rm *.txt"
> > There was an error:
> > *bash: /bin/mv: Argument list too long
> > *Here is the explanation and the workaround:
> --------------------
> BYU Unix Users Group 
> http://uug.byu.edu/ 
> 
> The opinions expressed in this message are the responsibility of their
> author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
> 

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to