/
๐Ÿ“

Chmod

https://en.wikipedia.org/wiki/Chmod
shunix
On this page
  • Numerical permissions
  • 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.

#PermissionrwxBinary
7read, write and executerwx111
6read and writerw-110
5read and executer-x101
4read onlyr--100
3write and execute-wx011
2write only-w-010
1execute only--x001
0none---000
  • chmod +x adds the execute permission for all users to the existing permissions.

  • chmod 755 sets the 755 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)
Edit this page
logo
Code-related notes and snippets