Chmod 775 in the folder, but not all files under this folder

by assigning 775 user rights to a folder (project) does this affect file permissions in the folder?

# chown -R root:user1 /var/www/project/ # chmod 775 -R /var/www/project/ 

Meaning, if /project/config.html used for the 664 right, does that mean the 664 right disappears and gives 775? How to avoid this? The /project/ section has files and folders with different permissions, and I don’t want them to be overridden.

+8
unix chmod chown
source share
2 answers

Remove the -R flag. This means that it also modifies all files and folders in a subdirectory.

 # chown root:user1 /var/www/project/ # chmod 775 /var/www/project/ 
+13
source share

Yes: -R means recursive. Delete -R

+4
source share

All Articles