The Over-Simplified Guide to Reading Linux Permissions You’ve Been Looking For

I had to draw this up for a co-worker today. I didn’t want to waste his time with metaphors and other nonsense. I wanted it to ‘click’. He wanted to know how drwx------ came out to ‘700’. This is what I came up with.

Examples

Linux permissions are displayed in 10 characters, like this:

drwxrwxrwx

The first character is the type of resource. Here are 3 common types you might encounter.1

File f
Directory d
Link l

The last nine are really groups of three.

UserGroupOther
rwx rwx rwx

rwx have integers attached to them.

LetterFunctionValue
r Read 4
w Write 2
x Execute 1

How it adds up

rwx = 7 because 4 + 2 + 1 = 7
rw- = 6 because 4 + 2 = 6
r-x = 5 because 4 + 1 = 5

Full Example:

drwxr-xr-x
TypeUserGroupOther
d rwx r-x r-x
7 5 5

1Special thanks to cantonboy329. I re-phrased this so that it can be accurate without going into too much detail.

1 Reply to “The Over-Simplified Guide to Reading Linux Permissions You’ve Been Looking For”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.