Convert an octal mode to rwx and back, read what each digit grants, and see what
setuid, setgid and the sticky bit actually do.
A special bit does not get its own column. It overwrites the execute position of its class, and the letter's case tells you whether execute was there underneath:
| Octal | ls -l shows |
Reading |
|---|---|---|
4755 |
rwsr-xr-x |
setuid, and the owner does have execute |
4644 |
rwSr--r-- |
setuid set, no execute under it: almost always a mistake |
2755 |
rwxr-sr-x |
setgid with execute |
2644 |
rw-r-Sr-- |
setgid without |
1777 |
rwxrwxrwt |
sticky with execute, as on /tmp |
1644 |
rw-r--r-T |
sticky without |
An uppercase letter in a mode string is a signal, not a typo: something was switched on that cannot currently do anything.
That table was produced on a real system before the code was written, by creating
files with each mode and reading back ls -l. The implementation is then tested
against it in both directions, plus the round-trip, before publishing.
It converts and explains a mode. It cannot see your filesystem, so it does not know whether a mode suits a given file. Ownership matters as much as the mode, and on systems using ACLs, SELinux or AppArmor the mode is only one of the layers deciding access.
Nothing is uploaded. No server, no analytics, no storage.
MIT.