On Monday 24 November 2008 10:52, David C. Rankin wrote:
Listmates,
I was trying to use chmod, but it says:
12:44 nirvana/srv/www/download> find . -type f -print0 | xargs -0 sudo chmod 0644 sudo: unable to execute /bin/chmod: Argument list too long
How long is too long? How many files will chmod do, or does it depend on the length of file names?
...
sudo find . -type f -exec sudo chmod 0644 '{}' \;
This is much...much... slower. How big is the chmod limitation and is there a better way to get around this limitation?
One would expect sudo to know the real system limit and impose that, but perhaps it has its own idea of the upper limit. I found no mention of this in man page, but one thing you can do is tell xargs to use a argument limit smaller than the system's: --max-chars=max-chars, -s max-chars Use at most max-chars characters per command line, including the command and initial-arguments and the terminating nulls at the ends of the argument strings. The default is 131072 characters, not including the size of the environment variables (which are provided for separately so that it doesn't matter if your envi- ronment variables take up more than 131072 bytes). The operat- ing system places limits on the values that you can usefully specify, and if you exceed these a warning message is printed and the value actually used is set to the appropriate upper or lower limit. Given that (putative) sudo limit is unknown, you might have to experiment to find an acceptable one.
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org