Click to See Complete Forum and Search --> : Error Deleting


jeff12
06-23-2001, 08:25 PM
I have two dirs in var/log which have many files and are taking up a lot of unneeded used space.

When I attempt to delete the files I get an error "Argument list too long". Any ideas?


Another thing is in /var/log/messages I noticed there's many occurances of "syslogd 1.3-3: restart." It seems to have that message almost every other second. Any ideas?

Thanks.

slapNUT
06-23-2001, 09:14 PM
There are only like five arguements you can pass to rm [drivf].

You should see the syslogd message when it restarts only. Maybe you should upgrade that to syslogd-1.4

Craig McPherson
06-23-2001, 09:49 PM
slapNUT: you're incorrect. Each file to be deleted is also an argument to rm. If you do "rm *" in a directory with 3000 files, rm will have 3000 arguments. It's easy to overflow the command line buffer.

You should be able to use xargs to feed a reasonable number of files to rm at a time:

find /directory/to/clean/out | xargs rm

Xargs will take a reasonable number of filenames from standard input, pass them as arguments to rm, then continue until it's done them all

jeff12
06-24-2001, 11:26 AM
Thanks for your help. I was able to delete the files in the directories with no problem using that command. I am still looking for syslogd upgrade.