Unix file permissions

Every Unix file has a set of permissions that determine if a user can read, write, or execute the file.

Permission flags

┌──────────── Type of file
│ ┌────────── User permissions
│ │  ┌─────── Group permissions
│ │  │  ┌──── Other permissions
│ │  │  │
-rwxr-xr-x  1 user group 7041 Sep 26 18:06 file.txt
ValueMeaning
-Permission has not been granted.
rFile is readable.
wFile is writable. For directories, files may be created or removed.
xFile is executable. For directories, you can access it and list its files.

Modifying permissions

OctalBinaryFlags
0000---
1001--x
2010-w-
3011-wx
4100r--
5101r-x
6110rw-
7111rwx

Resources