I have few directores inside a folder like below -

teckapp@machineA:/opt/keeper$ ls -ltrh
total 8.0K
drwxr-xr-x 10 teckapp cloudmgr 4.0K Feb  9 10:22 keeper-3.4.6
drwxr-xr-x  3 teckapp cloudmgr   4.0K Feb 12 01:44 data

I have some other folder as well in some other machines for which I need to change the permission to the above one like this drwxr-xr-x .

Meaning how can I change any folder permissions to drwxr-xr-x ? I know I need to use chmod command with this but what should be the value with chown that I should use for this?

Best Answer


To apply those permissions to a directory

chmod 755 directory_name

To apply to all directories within the current directory

chmod 755 */

If you want to modify all directories and subdirectories, you'll need to combine find with chmod .

find . -type d -exec chmod 755 {} +