chmod - change file mode bits
chmod [-R] MODE file...
Options you will use
-R, --recursive- Change files and directories recursively.
MODE (octal)- 4=read 2=write 1=execute, per owner/group/other. 750 = rwxr-x---
MODE (symbolic)- [ugoa][+-=][rwxXst], e.g. u+x, go-w, a=r, g+s
Examples
$ chmod 750 deploy.showner full, group read+execute, others nothing
$ chmod +x script.shthe missing bit behind half of the 203/EXEC failures
$ chmod 2775 /srv/sharedsetgid: new files inherit the directory group
$ chmod 1777 /tmpsticky: only the owner can delete their own files
Gotchas
- On a DIRECTORY: r = list the names, x = traverse into it and stat files by name. x without r means you can read a file whose name you already know but cannot ls.
Taught in
Try chmod in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.