17

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.

Sankar V
  • 4,110
  • 5
  • 28
  • 52

1 Answers1

33

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.

devnull
  • 118,548
  • 33
  • 236
  • 227