-----Original Message----- From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On Behalf Of James B. Byrne Sent: Monday, January 25, 2010 10:06 AM To: Robert Nichols Cc: centos@xxxxxxxxxx Subject: Re: The directory that I am trying to clean up is huge On Mon, January 25, 2010 10:31, Robert Nichols wrote: \ > > Now if the "{}" string appears more than once then the command line > contains that path more than once, but it is essentially impossible > to exceed the kernel's MAX_ARG_PAGES this way. > > The only issue with using "-exec command {} ;" for a huge number of > files is one of performance. If there are 100,000 matched files, > the command will be invoked 100,000 times. > > -- > Bob Nichols RNichols42@xxxxxxxxxxx > Since the OP reported that the command he used: find -name "*.access*" -mtime +2 -exec rm {} \; in fact failed, one may infer that more than performance is at issue. The OP's problem lies not with the -exec construction but with the unstated, but nonetheless present, './' of his find invocation. Therefore he begins a recursive descent into that directory tree. Since the depth of that tree is not given us, nor its contents, we may only infer that there must be some number of files therein which are causing the MAXPAGES limit to be exceeded before the recursion returns. I deduce that he could provide the -prune option or the -maxdepth= 0 option to avoid this recursion instead. I have not tried either but I understand that one, or both, should work. I still suspect that the OP had an unquoted wildcard someplace on his original command. Either a find * -name ..., or find . -name *.access*... I see people all the time forget to quote the argument to -name, which would normally work if the wildcard doesn't match more than 1 file in the current directory. But if there is more than 1 file, then find will return an error since the second file would likely not match an option to find. If there are too many matches in the current directory, the unquoted example would fail even before the find command could execute. _______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos