Linux: command to make folders recursively writable without affecting the permission of files inside them

Sankar V picture Sankar V · Nov 22, 2013 · Viewed 29k times · Source

Is it possible to make the folders writable recursively without affecting the files inside them using Linux command.

chmod 777 -R foldername - will make all folders and files inside the folder writable.

We've a website where we do not want the core files of a php framework writable, but at the same time we should be able to add new files.

Answer

devnull picture devnull · Nov 22, 2013

You can say:

find foldername -type d -exec chmod 777 {} \;

This would only change the file mode for the directories and not the files within those.