Permissions on directories and files

Hello,

I have a main directory called /test123

/test123 has lot of sub-directories and files.

drwxr-x--- 21 root system 4096 Jan 25 10:20 /test123

Here, "other" does not have any access to /test123 folder.

How can we provide read-only access to others on /test123 content ?

I understand that all directories and sub-directories need "x" permission as well

If I run chmod -R o+r /test123 , directories wont get "x" permission.

I want to get read and execute on directories/sub-directories and Read only on files for others. please explain.

To set other-read and other-executable bits on all folders in a tree:

find /test123 -type d -exec chmod o+rx '{}' ';'

This is different than chmod -R in that it doesn't set the files, too.

1 Like