DEVESSENTIALS

Common chmod Modes Explained

One page per permission mode: what each digit means for the owner, group and everyone else, the symbolic form you see in ls -l, where the mode is the right choice, the security risks, and the exact chmod and find commands to apply it safely.

Everyday files and directories

Private and group-only

Read-only

World-writable (handle with care)

Special bits: setuid and sticky

Reading any mode in ten seconds

Read is 4, write is 2 and execute is 1. Each digit is the sum for one class: owner, group, others. So 7 is rwx, 6 is rw-, 5 is r-x, 4 is r-- and 0 is ---. A fourth, leading digit adds the special bits: 4 for setuid, 2 for setgid and 1 for the sticky bit.

On a directory, read lets you list names, write lets you create and delete entries, and execute lets you enter it and reach files inside. That is why directories are usually 755 or 750 while files are 644 or 640.

Don't see your mode? Tick the boxes in the chmod calculator to convert any combination, or read Linux file permissions explained for chown, umask and ACLs.