A
A
AndreyMasalov2022-01-16 20:08:34
linux
AndreyMasalov, 2022-01-16 20:08:34

How to recursively add write permissions for the others group to all nested directories and files?

How is it possible to recursively add write (w) permissions for the others group to all nested directories and files, without changing the read and execute permissions for the same user group?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2022-01-16
@AndreyMasalov

chmod -R g+w /path/to/directoryprovided that all files and directories belong to the others group

V
Victor Taran, 2022-01-16
@shambler81

find /var/www/site.ru/ -type f -exec chmod -R g+w {} \;

find- recursive search
/var/www/site.ru path
-type fonly
-exec to execute files with found (find itself function) then
the command to
{}substitute the path of what will be found
\;- just close it.
and here are the classic changes in the rights to files and directories
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question