chmod u=rwx,g=rx,o=r <file> # Set the rights to -rwxr-xr--
chmod o-r <file> # Remove 'read' from others
chmod g+w <file> # Add 'write' to group
chmod -R 754 <directory> # Set the rights to -rwxr-xr-- recursive
┌─────┬─────┬─────┐
│ r-- │ -w- │ --x │
│ 4 │ 2 │ 1 │
├─────┼─────┼─────┼─────┐
│ rw- │ r-x │ -wx │ rwx │
│ 6 │ 5 │ 3 │ 7 │
└─────┴─────┴─────┴─────┘
sudo chmod -R 777 name-file-wht-upu-want ///open for accsess all users
sudo chmod 644 #for example file /etc/hosts
https://ss64.com/bash/chmod.html
chmod u=rwx,g=rx,o=r myfile
chmod 754 myfile
# 4 stands for "read",
# 2 stands for "write",
# 1 stands for "execute", and
# 0 stands for "no permission."
For changing permissions mode of files as "file.exe" follow next examples idea:
chmod file.exe ugo+x #Add x:execute permissions to u:user g:gropu and o:others
chmod file.exe o-rw #Remove r:read and w:write permissions to o:others
chmod file.exe +rwx #Add all r:read, w:wirte and x:execute permissions to all.
chmod file.exe +rwx
chmod -R 777 ./
chmod -R 777 diretorio