Linux: Chmod recursively
Change all the persmissions at the same time :
chmod -R +xr
To make everything writable by the owner, read/execute by the group, and world executable:
chmod -R 0755
To make everything wide open:
chmod -R 0777
Â
In order to get both read access and execute access,to list a directory.In case to execute access , then you can find out the names of entries in the directory, but no other information (not even types, so you don’t know which of the entries are subdirectories).
find . -type d -exec chmod +rx {} \;
Â
- Use chmod -R 755 /opt/lampp/htdocs if you want to change permissions of all files and directories at once.
- Use find /opt/lampp/htdocs -type d -exec chmod 755 {} \; if the number of files you are using is very large. …
- Use chmod 755 $(find /path/to/base/dir -type d) otherwise.
- Better to use the first one in any situation.
To make everything writable by the owner, read/execute by the group, and world executable:
1
|
chmod -R 0755 |
To make everything wide open:
1
|
chmod -R 0777 |
The correct recursive command is:
sudo chmod 755 -R /opt/lampp/htdocs
-R
: change every sub folder including the current folder