Chmod
chmod is used to change permissions of files. If you wanna change the owner of files, please refer to chown.
usage: chmod [-param][<permission_range>+/-/=<permission_setting>] file/directory
- Change permission for "some user":
chmod [u/g/o/a][+/-/=][r/w/x/-] file[u/g/o/a]stands for "some user"uUser, the owner of filegGroup, the group owner of fileoOther, other users and groups exceptuandgaAll.
[+/-/=]: add permission / cancel permission / cancel all previous permissions and add the only permission[r/w/x/-]: read / write / execute / none permission
- Change permission simultaneously for user(
x), group(y) and others(z):chmod [xyz] filex y zare integers, the sum of read(4), write(2) and execute(1).- eg:
chmod 764 file1. User = 7 (4+2+1) r+w+x, group = 6 (4+2) r+w, other = 4 r.
- Params:
-creport when changes are made-fdo not output errors-Rchange permissions for directory and sub files recursively.-voutput detailed logs