Skip to content

Instantly share code, notes, and snippets.

@paulera
Created February 26, 2018 15:07
Show Gist options
  • Save paulera/2e37ae821849e281f264708b7023ae98 to your computer and use it in GitHub Desktop.
Save paulera/2e37ae821849e281f264708b7023ae98 to your computer and use it in GitHub Desktop.
Set file permissions 775 for dirs and 664 for files
#!/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