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.
You can change permissions of files using numeric or symbolic mode with the chmod command. Use the chmod command with the R (recursive) option to work on all directories and files under a given directory. The permissions of a file can be changed only with the user with sudo priviledges, or the file owner.
If you need to change a file permission, use the chmod command. It also allows to change the file permission recursively to configure multiple files and sub-directories using a single command.
Changing permissions with chmod To modify the permission flags on existing files and directories, use the chmod command ("change mode"). It can be used for individual files or it can be run recursively with the -R option to change permissions for all of the subdirectories and files within a directory.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With