Skip to content

Instantly share code, notes, and snippets.

@xorenio
Last active April 5, 2018 18:04
Show Gist options
  • Save xorenio/97d1f6f6511c2a50100c to your computer and use it in GitHub Desktop.
Save xorenio/97d1f6f6511c2a50100c to your computer and use it in GitHub Desktop.
Fixing all the file perm on a website
#!/bin/sh
echo "Fixing perissions for files and folders."
find . -type f -name '*.php' -exec chmod 600 {} \;
find . -type f -name '*.html' -exec chmod 644 {} \;
find . -type f -name '*.htm' -exec chmod 644 {} \;
find . -type f -name '*.xml' -exec chmod 600 {} \;
find . -type f -name '*.css' -exec chmod 755 {} \;
find . -type f -name '*.less' -exec chmod 644 {} \;
find . -type f -name '*.js' -exec chmod 644 {} \;
find . -type f -name '*.png' -exec chmod 644 {} \;
find . -type f -name '*.jpg' -exec chmod 644 {} \;
find . -type f -name '*.txt' -exec chmod 644 {} \;
find . -type f -name '*.conf' -exec chmod 600 {} \;
find . -type f -name '*.txt' -exec chmod 644 {} \;
find . -type f -name '*.yml' -exec chmod 600 {} \;
find . -type f -name '*.less' -exec chmod 600 {} \;
find . -type d -exec chmod 755 {} \;
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment