Linux file Permission – Oversimplified

Here’s a quick and dirty example to demonstrate Linux file permissions and how to read them.

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.

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

Done!


– masterkenneth

Leave a Reply

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