Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created December 13, 2017 12:53
Show Gist options
  • Save bytefade/204f933ffb1af872e2156ff40ccc2e18 to your computer and use it in GitHub Desktop.
Save bytefade/204f933ffb1af872e2156ff40ccc2e18 to your computer and use it in GitHub Desktop.
Permission sever chmod
cd /var/www/image
#For file like image you don't need execution permission :
sudo chmod 664 *
#If you have directories inside image and you want to apply permission :
sudo find . -type d -exec chmod 755 "{}" \;
#This will recursively search your directory and chmod 755 all directories only.
#Similarly, the following will chmod all files only (and ignore the directories):
sudo find . -type f -exec chmod 644 "{}" \;
#File name with space case (thanks to Nicklas B)
find . -type f -print0 | xargs -0 chmod 644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment