The Permission Model

Read, Write, Execute

Every file has permissions for three classes: user (owner), group, other.

-rwxr-x r--   1 alice devs  4096 file
 │└┬┘└┬┘└┬┘
 │ u  g  o
 └ type (- file, d dir, l link)
SymbolOctalFile meaningDirectory meaning
r4read contentslist entries
w2modify contentscreate/delete entries
x1executeenter (cd into)

Common octal modes: 755 (rwxr-xr-x), 644 (rw-r--r--), 700 (rwx------), 600 (rw-------).

CommandAction
chmod 640 fileSet octal permissions
chmod u+x,g-w fileSymbolic change
chown alice:devs fileChange owner + group
chgrp devs fileChange group only
chmod -RRecurse into directories
$ chmod 640 report.txt && ls -l report.txt
-rw-r----- 1 alice devs 0 Jan 1 10:00 report.txt