Created
December 13, 2017 12:53
-
-
Save bytefade/204f933ffb1af872e2156ff40ccc2e18 to your computer and use it in GitHub Desktop.
Permission sever chmod
This file contains hidden or 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
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