Skip to content

Instantly share code, notes, and snippets.

@glegoux
Last active July 27, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glegoux/a37a7fd6fd85ee54446e725c3df2b1b0 to your computer and use it in GitHub Desktop.
Save glegoux/a37a7fd6fd85ee54446e725c3df2b1b0 to your computer and use it in GitHub Desktop.
#!/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