The power of permissions
Each file in Linux has a set of user and group permissions, and you can use ls -l to see a file’s full set of permissions and attributes. The output begins with the permission flags like this drwxr-xr-x that has four components: $ ls -l -rwxrw-r-- 1 bodhi bodhi 23339 Dec 13 08:47 some-document.pdf drwxr-xr-x 3 bodhi bodhi 4096 Feb 4 12:32 Desktop
The first character indicates whether the corresponding item is a directory or a file with a directory marked with a d character and a regular file marked with a hyphen ( - ). The next nine characters are broken up into sets of three characters each, which indicate permissions for the user, group and everyone else respectively. The r denotes read permission, w is for write permissions and x points to execute permissions. The first entry in the example reads rwxrw-r-- , which means the user has read, write and execute permissions, while other members of the group have read and write permissions and everyone else can only read the file.
Sometimes the permissions are represented with a numerical notation. Read permissions weigh in at 4, write is 2 and execute is 1. So the permission rwxr-x--x can be presented as (4+2+1)(4+0+1)(0+0+1) or 751.