Files and finding
8 minThe execute bit on a directory
Three triples, checked in order and exclusively.
A mode is three triples: owner, group, everyone else. They are checked in that order and exclusively — if you are the owner, only the owner triple applies, and being in the group cannot give back a permission the owner triple denies.
chmod 077 file locks the owner out of their own file while everyone else reads it. That is not a bug; it is the rule.
Try this
On a directory the bits mean something different. Read is permission to list it; execute is permission to traverse it. They are independent.
A directory with --x can be walked through but not listed: you can read a file inside it if you know its name. One with r-- can be listed but nothing inside it can be reached.
Try this
$
Files
| Mode | Links | Size | Name |
|---|---|---|---|
| drwxr-xr-x | 3 | exports/ | |
| -rw-r--r-- | 1 | 29 | a.txt |
| -rwxr-xr-x | 1 | 18 | script.sh |
| drwxr-xr-x | 3 | work/ | |
| -rw-r--r-- | 1 | 29 | b.txt |
| -rw-r--r-- | 1 | 36 | c.log |
| drwxr-xr-x | 2 | deep/ | |
| -rw-r--r-- | 1 | 29 | d.txt |
| -rw-r--r-- | 1 | 33 | top.txt |