Skip to content

Instantly share code, notes, and snippets.

@tavinus
Last active September 2, 2020 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tavinus/3db27c658f24fe160c0dbf7c554d8959 to your computer and use it in GitHub Desktop.
Save tavinus/3db27c658f24fe160c0dbf7c554d8959 to your computer and use it in GitHub Desktop.
Chmod How-To

CHMOD numbers list

Each chmod SUM NUMBER means:

1 > --x
2 > -w-  
3 > -wx (2 + 1)
4 > r--
5 > r-x (4 + 1)
6 > rw- (4 + 2)
7 > rwx (4 + 2 + 1)

You sum each option to get the final number,
max at 7 with 4 + 2 + 1

r - (4) read
w - (2) write
x - (1) execute

You also have each sum for user, group, all

So chmod 735 test would receive

  • User 7 : rwx
  • Group 3 : -wx
  • All 5 : r-x
$ ls -l test
-rwx-wxr-x 1 guneves guneves 0 Jul 25 02:23 test
@tavinus
Copy link
Author

tavinus commented Jul 25, 2018

reserved ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment