Linux: chmod - permission only for files or only for folders

Trabla:
1. need set permission 755 only for folders (and subfolders) in directory
2. need set permission 644 only for files (and subfolders) in directory


Solving:

1. Set permission only for    folders   and   sub-folders 
 sudo find . -type d -exec chmod 755 {} \;

where

find .  - find in current directory
-type d     -  type of items is directory
755 - octal permission

2. Set permission only for   files   in sub-folders
sudo find . -type f -exec chmod 644 {} \;




find .  - find in current directory
-type d     -  type of items is files
755 - octal permission

No comments:

Post a Comment