Unix permissions
Unix file permissions: read chmod modes without guessing
A chmod mode describes ordinary owner, group, and other permission bits. It does not include every control that can affect access on a real machine.
Read each octal digit as three permissions
Read is 4, write is 2, and execute is 1. Add the enabled values for owner, group, and other: 0755 therefore means rwxr-xr-x. A leading fourth digit carries setuid, setgid, and sticky bits. It is useful for inspecting a stated mode, not for deciding who should receive access.
| Value | Bits | Meaning |
|---|---|---|
| 4 | r-- | read |
| 2 | -w- | write |
| 1 | --x | execute/search |
Directory execute/search is not file execution
For a regular file, execute permits running it as a program. For a directory, execute/search permits traversing it and accessing entries when their own permissions allow it. Directory read lists names; directory write affects entries, usually together with execute/search. The same 0755 mode therefore has different practical effects on a file and a directory.
umask shapes future creation, not effective access
A process umask clears ordinary permission bits from the mode requested when it creates a file or directory. The conventional request is 0666 for a regular file and 0777 for a directory, so umask 022 commonly produces 0644 and 0755. It does not add permissions, and an application can request fewer bits than those conventional values.
A numeric umask calculator is only a reproducible model of that convention. It does not inspect a process, user profile, service manager, container, filesystem, or existing path. On Linux, a default ACL on the parent directory can change the mode instead of the umask result.
Treat special bits as high-context settings
setuid can make an executable run with its file owner's effective user ID. setgid can affect an executable's effective group ID and, on many systems, make new directory entries inherit a directory group. The sticky bit restricts unprivileged removal or renaming in a directory. The lowercase s or t means execute/search is also set; uppercase S or T means the special bit is set without it.
Use absolute modes only, then check the host
This tool accepts a three- or four-digit octal mode, or an ls-style rwx string. It rejects relative operations such as u+x because their result depends on an existing mode and can also depend on umask. It does not parse a command, recurse into directories, or inspect a path.
ACLs, ownership, privileges, mount options, capabilities, mandatory access-control policies, network filesystems, and symlink behavior can all change effective access. GNU chmod also documents directory-specific special-bit behavior. Inspect the target platform before changing production permissions.
0755 = rwxr-xr-x; 1777 = rwxrwxrwt; 4644 = rwSr--r--Data provenance