Often, I find myself needing to make a tree of directories executable for someone, ie:
find . -type d -exec chmod ug+x {} \;
But I don't like the overhead of find, and running a "new"chmod for every dir.
You folks have preferred alternatives?
Printable View
Often, I find myself needing to make a tree of directories executable for someone, ie:
find . -type d -exec chmod ug+x {} \;
But I don't like the overhead of find, and running a "new"chmod for every dir.
You folks have preferred alternatives?
have u tried chmod -R?
chmod -R will make ALL files executable, I only want the x bit set in directories.
chmod -RX . is a better, but only if none of the regular files have any of thier x bits set. The best I have found is:
This variant of the -exec action runs the specified command on the selected files, but the command line is built by appending each selected file name at the end; the total number of invocations of the command will be much less than the number of matched files.Code:find . -type d -exec chmod ug+x {} +
what about just calling one chmod on the output of the find command? e.g.:
does that do what u want? I've never used the '+' with find before...Code:chmod +x `find . -type d whatever`