Reading Permission Strings
Rwxr-xr-x decoded.
Those ten characters at the start of every long listing line looked like nonsense before. Now you know enough to read them. Let's decode them, one group at a time.

- Ten characters
- Now you can read them
- One group at a time
Splitting the string
Take RW dash R dash dash R dash dash. The first character is the type. A dash for a file, D for a directory. Then come three groups of three. The first three are the owner's permissions. The next three are the group's. And the last three are for everyone else. A dash means that permission is missing.
Reading real examples
Here are three real examples. Notes dot TXT is RW, R, R. Sam can read and change it, everyone else can only read it. The Documents folder has X everywhere, so anyone can go inside. And the password file, slash ETC slash shadow, can't even be read by Sam.
ls -l notes.txt -rw-r--r-- 1 sam sam 30 Jan 5 09:00 notes.txt ls -ld Documents drwxr-xr-x 2 sam sam 4096 Jan 5 09:00 Documents ls -l /etc/shadow -rw-r----- 1 root shadow 575 Dec 20 10:00 /etc/shadow
Common patterns
You'll see a few patterns again and again. RW, R, R, for normal files. RWX, RX, RX, for programs and folders. RW, then nothing, for private files, like keys. And RWX, then nothing, for private folders.
| key | value |
|---|---|
| rw-r--r-- | normal file |
| rwxr-xr-x | program or folder |
| rw------- | private file |
| rwx------ | private folder |
Summary
The string is a type, then three groups of RWX, for the owner, the group, and others. A dash means no. Next, changing permissions with CH mod.
Key takeaways- type + 3 × rwx
- owner, group, others
- - means no