Last active
July 27, 2017 08:44
-
-
Save glegoux/a37a7fd6fd85ee54446e725c3df2b1b0 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# | |
# reset-filesystem-permission.bash | |
# | |
# Reset permission of current directory only files, subfolders and current folder | |
# from umask. | |
# | |
# /!\ This action can be hard to reverse, please use that with precaution. | |
# Change files permission | |
find . -type f -print0 | xargs -0 chmod $((10#0666 - 10#$(umask))) | |
# Change directories permission | |
find . -type d -print0 | xargs -0 chmod $((10#0777 - 10#$(umask))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment