On Tuesday January 13 2009, Henare Degan wrote:
On Wed, Jan 14, 2009 at 12:42, Cristian Rodríguez
wrote: find /path/of/directory -type f -exec chmod 600 {} +
Thanks very much to everyone that responded. I always thought there was an option of chmod (or similar) that did not change the 'x' bit on directories but I guess not.
I found Cristian's solution the most elegant (I even learnt a bit more about the -exec option of find, after bothering to read the man page to understand what the curly braces and plus did at the end of the command).
Randall, using the symbolic mode versus numeric mode doesn't change how the command affects directories versus files (although I may have missed the point you were making in your mail ;)
% chmod -R o+rw /path/of/directory If an entry has execute bits, it will keep them, if it doesn't, it won't get them. Isn't that what you want? If there are a lot of files in the hierarchy, all the solutions based on the -exec option to find will be significantly slowed because a fork / exec pair will have to happen for each file. With a recursive use of chmod a single process will do all the work, which is far more efficient.
Thanks again everyone,
h
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org