๐
Chmod
On this page
chmod: change modes, which is used to change access permissions of file systems objects (files and directories)
Modes are the filesystem permissions given to user, group, and others.

Numerical permissions
The chmod numerical format accepts up to four octal digits. The three rightmost digits define permissions for the file user, the group, and others.
# | Permission | rwx | Binary |
---|---|---|---|
7 | read, write and execute | rwx | 111 |
6 | read and write | rw- | 110 |
5 | read and execute | r-x | 101 |
4 | read only | r-- | 100 |
3 | write and execute | -wx | 011 |
2 | write only | -w- | 010 |
1 | execute only | --x | 001 |
0 | none | --- | 000 |

chmod +x
adds the execute permission for all users to the existing permissions.chmod 755
sets the755
permission for a file.755
means full permissions for the owner and read and execute permission for others.- 7 --> u=rwx (4+2+1 for owner)
- 5 --> g=rx (4+1 for group)
- 5 --> o=rx (4+1 for others)