Reference

chmod cheat sheet

The modes you actually type, what each bit does, and how to read the rwx string — in one place, print-friendly.

Modes you will actually type

Common permission modes
Octal Symbolic Typical use
644-rw-r--r--Regular files: config, HTML, images
755-rwxr-xr-xScripts, binaries, directories
600-rw-------Secrets: SSH keys, .env files
700-rwx------Private directories
400-r--------Read-only key material
664-rw-rw-r--Group-writable shared files
2775drwxrwsr-xShared dir, group inherited (setgid)
1777drwxrwxrwtWorld-writable temp dir (/tmp)
777-rwxrwxrwxAlmost never correct

What each bit does

Permission bits
Value Bit On a file On a directory
4readRead contentsList entries
2writeModify contentsCreate / delete entries
1executeRun as a programEnter / traverse
4000setuidRuns as the file ownerNo effect on Linux
2000setgidRuns as the file groupNew entries inherit the group
1000stickyNo effect on LinuxOnly the owner may delete an entry

Reading the symbolic string

Symbolic notation
Character Position Meaning
dTypeDirectory (- file, l symlink)
sOwner / group executesetuid or setgid, execute also set
SOwner / group executesetuid or setgid, execute not set
tOther executeSticky bit, execute also set
TOther executeSticky bit, execute not set

Common umask values

umask defaults
umask New files New directories
022644755
002664775
027640750
077600700

Need to work out a specific mode? Open the calculator · unsure what a mode means? Read the FAQ.