Linux – File Ownership and Permissions
Akkkk. Linux file permissions drive me crazy. Yes they are completely necessary (or so I am told) but I feel like I fight with them all the time.
Here is my cheat sheet for viewing and changing permissions:
View Owner and Permissions
ls -l or ls -l filename
It shows the permission settings, grouped in a string of characters (-, r, w, x) classified into four sections:
- File type. There are three possibilities for the type. It can either be a regular file (–), a directory (d) or a link (i).
- File permission of the user (owner)
- File permission of the owner’s group
- File permission of other users
Change ownership

chown [OPTIONS] USER[:GROUP] FILE(s)
The following example will change the ownership of all files and subdirectories:
chown -R user:group /file/path/
-R means recursive
Change permissions
In symbolic notation, we provide chmod with a comma-separated string using references for user (u), group (g) and others (o).
We can set these same permissions with the symbolic notation:
chmod u=rwx,g=rw,o=r <document.docx>
the privledges you can give are r, w, and x, for read, write, and execute
What about these numbers? basically the same thing – you can do:
chmod 764 filename
Where each of the three numbers above are User Owner Group permissions – equivalent to the chmod u=rwx,g=rw,o=r example above
With the numbers:
7 = read, write, and execute
6 = read and write
5 = read and execute
4 = read only