change directory permissions in linux code example
Example 1: debian give write permission
sudo chmod -R 757 /var/www
Example 2: bash how to change the permissions on all directories and subdirectories
find /path/to/directory -type d -exec chmod 775 {} \;
Decimal Binary Permission Permission meaning
7 111 rwx read, write, and execute
6 110 rw- read and write
5 101 r-x read and execute
4 100 r-- read only
3 011 -wx write and execute
2 010 -w- write only
1 001 --x execute only
0 000 --- none
Example 3: change the permissions of a folder in linux
sudo chmod -R 757 <file>
Example 4: how to change permissions on a file in linux
sudo chmod -R ugo+rwx /file/path
Example 5: changing folder permission in linux
chown {user:group} {directory} -R
Example 6: how to change permission of a folder linux
chmod 777 foldername