changing the permissions

HI,
I wann give permissions to a folder which contains multiple folders.....

how can i give permissions to all folder at a time
tat means if i give permissions to main folder it
the same permissions has to take on all the folders in the main folders

how can i use one command to give permissions

chmod -R 660 /path/to/dir

will change the permissions of all folders and files inside the folder '/path/to/dir', including /path/to/dir itself.

To do just folders:

find /path/to/dir -type d -exec chmod 0600 '{}' ';'

Or just files:

find /path/to/dir -type f -exec chmod 0600 '{}' ';'

On systems that support it, you can change ';' to '+' to make it more efficient, reducing the number of times it calls chmod by using as many arguments as safely possible.

1 Like