Created
February 26, 2018 15:07
-
-
Save paulera/2e37ae821849e281f264708b7023ae98 to your computer and use it in GitHub Desktop.
Set file permissions 775 for dirs and 664 for files
This file contains hidden or 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
#!/bin/bash | |
# | |
# This will set | |
# Directories: 775 (read-write-exec for owner and group, read-exec for others) | |
# Files: 664 (read-write for owner and group, read for others) | |
# for all files expect .git folder. | |
# --> Remove `-name .git -prune -o` to extend it to git files. | |
find . -name .git -prune -o -type d -exec chmod 775 {} \; | |
find . -name .git -prune -o -type f -exec chmod 664 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment