Example command: chmod 755 filename
Example command: chmod u=rwx,g=rx,o=rx filename
No permissions set
Each digit represents permissions for owner, group, and others respectively.
Digit | Binary | Permissions |
---|---|---|
0 | 000 | --- |
1 | 001 | --x |
2 | 010 | -w- |
3 | 011 | -wx |
4 | 100 | r-- |
5 | 101 | r-x |
6 | 110 | rw- |
7 | 111 | rwx |
These are some commonly used permission combinations:
Octal | Symbolic | Description |
---|---|---|
755 | rwxr-xr-x | Owner has full access, others can read/execute |
644 | rw-r--r-- | Owner can read/write, others can only read |
777 | rwxrwxrwx | Everyone has full access (not recommended) |
600 | rw------- | Only owner can read/write |
750 | rwxr-x--- | Owner has full access, group can read/execute |
For files: ability to read contents
For directories: ability to list contents
For files: ability to modify contents
For directories: ability to create/delete files
For files: ability to execute as program
For directories: ability to access contents
When set on an executable, it runs with the privileges of the file owner.
When set on an executable, it runs with the privileges of the file group.
When set on a directory, only the owner can delete files within it.