Linux Permissions
Linux permissions are set for three groups on each file or folder. The three groups are Owner, Group and World. If I open a terminal and type;
ls -la
drwxr-xr-x 44 drupalpro drupalpro 4096 Mar 27 18:03 .
drwxr-xr-x 4 root root 4096 Jun 17 2012 ..
drwx------ 3 drupalpro drupalpro 4096 Jun 22 2012 .adobe
drwxr-xr-x 8 drupalpro drupalpro 4096 Jun 22 2012 Aptana_Studio_3
-rw-rw-r-- 1 drupalpro drupalpro 5188 Jun 22 2012 .bash_aliases
-rw-rw-r-- 1 drupalpro drupalpro 16168 Mar 27 19:00 .bash_eternal_history
-rw------- 1 drupalpro drupalpro 6935 Mar 27 17:33 .bash_history
-rw-r--r-- 1 drupalpro drupalpro 220 Jun 17 2012 .bash_logout
-rw-r--r-- 1 drupalpro drupalpro 3486 Jun 17 2012 .bashrc
drwx------ 12 drupalpro drupalpro 4096 Mar 27 16:31 .cache
drwxr-xr-x 7 drupalpro drupalpro 4096 Mar 12 07:09 commerce_kickstart
drwxrwxr-x 7 drupalpro drupalpro 4096 Mar 26 16:40 commons
So looking at the last one on the list we see the first part of the listing drwxrwxr-x give the permissions for the directory commons. The permissions work from left to right in this order ( Owner, Group and World). What this tells us is that its a directory (drwxrwxr-x) and that the owner has rwx permissions (read,write,execute), the group has rwx permissons (read,write,execute) and the world has r-x (read,execute).
Octal | Decimal | Permission | |
000 | 0 (0+0+0) | no permission | --- |
001 | 1 (0+0+1) | execute | --x |
010 | 2 (0+2+0) | write | -w- |
011 | 3 (0+2+1 | write and execute | -wx |
100 | 4 (4+0+0) | read | r-- |
101 | 5 (4+0+1) | read and execute | r-x |
110 | 6 (4+2+0) | read and write | rw- |
111 | 7 (4+2+1) | read and write and execuute | rwx |