[Linux-disciples] Large argument lists
Adam Rosi-Kessel
adam at rosi-kessel.org
Fri Jul 21 13:21:01 EDT 2006
Stephen R Laniel wrote:
> If you try to do something like 'rm dirName/*' when dirName
> contains lots of files, you'll get an error like
> '/usr/bin/rm: Argument list too long'. So then you'll need
> to do something like
>
> find dirName -mindepth 1 -depth -print0 |xargs -0i rm -R '{}'
>
> If you're writing a script that has to process lots of
> directories with many files, you end up having to do this
> with every command.
>
> Is there some prepackaged set of scripts that replaces bash
> commands with versions like the above that work with large
> collections? Or do we just need to write these on our own?
I'm not aware of any all-purpose solution, but why aren't you just doing rm
-r dirName in this case?
More information about the Linux-disciples
mailing list