Numerical Permissions

Numerical permissions describe the permissions of the file or folders and is most likely known with FTP or the unix filesystem. This post explains the meaning of those numerical permissions.

The structure

The permissions are separated in three types:

  • Read, which is represented by the number 4
  • Write, which is represented by the number 2
  • Execute, which is represented by the number 1

The numerical permission are based on the sum of the numbers above. So when we start combining, we can create the following list:

7read, write and execute
6read and write
5read and execute
4read
3write and execute
2write
1execute
0none

Numerical notation

Now we know the structure of the permissions, we can look at the full number you see in your file manager or FTP client. What you’ll see there is something like: 644.

644
The first number describes the permissions for the user. As stated in the table above, we see the 6 describes read (4) and write (2). The user has read and right permissions.

644
The second number describes the permissions for the group. As stated in the table above, we see the 4 describes read (4). The group has read rights.

644
The third number describes the permissions for the public. As stated in the table above, we see the 4 decribes read (4). The public has read rights.

Textual notation

The notation can be numerical but also textual. The permissions are notated in 10 characters. As example we use: -rwxr--r--

The first character says more about the type then a permission:

File
dDirectory
lLink
sSocket

In this example the first character is a - so it’s a file.

The next 9 characters can be split in pieces of 3 characters:
rwx = user (read, write en execute)
r-- = group (read)
r-- = public (read)

Which can be transformed to the numerical representation:
rwx = 4 + 2 + 1 = 7
r-- = 4 + 0 + 0 = 4
r-- = 4 + 0 + 0 = 4

Which results in the numerical permission of 744 .