Created
February 27, 2015 22:08
-
-
Save zsim0n/208945df4ab2ebf5da91 to your computer and use it in GitHub Desktop.
how-to-chmod-755-all-directories-but-no-file-recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /path/to/base/dir -type d -exec chmod 755 {} + | |
To recursively give files read privileges: | |
find /path/to/base/dir -type f -exec chmod 644 {} + | |
Or, if there are many objects to process: | |
chmod 755 $(find /path/to/base/dir -type d) | |
chmod 644 $(find /path/to/base/dir -type f) | |
Or, to reduce chmod spawning: | |
find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 | |
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644 | |
http://superuser.com/questions/91935/how-to-chmod-755-all-directories-but-no-file-recursively |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment