I had this problem once.... when you ls the list, you'll see that many of
them have similar characteristics, so you can do an rm -f thifile???.*, and
delete them a few at a time...
In my particular instance, this did not work, as there were, like 10000 of
each similar filename (It was an SGI server being used for IC testing - over
500000 records)... I did an ls -al > input.file, and then wrote a quick C
program to go through and delete everything one by one... The program goes
something like this, you'll have to figure out the specifics yourself...
(-ls is required to put the output as one file per line). This code
probably won't work as is, 'cuz I'm going from memory, and don't have a
compiler here to test with.
#include <stdio.h>
#include <system.h>
int main( int argc, char *argv[])
{
char filename[256];
char command[500];
FILE *infile;
infile = fopen("input.file","rt+") /* open the input file */
while( !eof(infile) )
{
fscanf(infile, %s, filename); /* read the filename from the
input file */
strcat( "rm -rf ", comand); /* build the command to be run
*/
strcat( filename, command);
system( command ); /* run the command */
}
return(1); /* exit the program */
}
> -----Original Message-----
> From: SoloCDM [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 16, 2000 10:46 AM
> To: Red Hat-List (redhat-list-request)
> Subject: LS Command Error
>
> Recently I executed the following command:
>
> rm -f dummy "ls -t msg.* | sed -e 1,900d"
>
> As a result, I received the following error:
>
> bash: /bin/ls: Argument list too long
>
> I know why (14,522 msg.* files exist in the directory), but I need a
> solution.
>
> Note: Detailed Documentation(s) and Sample(s) are more than welcome.
> When you reply to this message, please include
> the mailing list and my address.
>
> *********************************************************************
> Signed,
> SoloCDM
>
>
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.