Is there a web based converter between rwx and the octal version?

This site provides an interactive way to see what permissions bits are set when various bits are set/unset.

  • http://permissions-calculator.org/

The "calculator" looks like this:

  ss#1


Why do you need an octal number in the first place?

I always use:

chmod o+x file   # all + eXecute permissions
chmod g-w file   # group - write perms
chmod u=r file   # user can just read
chmod ug=rw file # user,group = read and write
chmod a+w file   # user,group,others + write 

ugo(a) is easy to remember. However, you can confuse o:=owner? o:=other? But what would be u, if o=owner? u:=user, therefore o=other.

Some commands like numerical permissions only. Okay, it's not hard to calculate, if you remember the two sequences: ugo + rwx.

    r   w   x  | Sum
u   4   2   1  | 7
g   4   -   1  |  5
o   4   2   -  |   6
---------------------
                 756

Yes, very artificial.

When it comes to s and S I have to consult the manual. Maybe google next time. :)


Octal is used for permissions because it's an easy conversion. Each group of rwx forms one octal digit. All you have to remember is the first 3 powers of 2: 4, 2, 1. r = 4, w = 2, x = 1.

rw-r--r-- = 110 100 100 = 4+2+0 4+0+0 4+0+0 = 644