Last updated: April 12, 2026
chmod Permissions Cheatsheet
Quick Answer
chmod sets file permissions using octal numbers. Each digit represents owner/group/others. 4=read, 2=write, 1=execute. Common patterns: 755 for executables, 644 for files, 600 for secrets.
Common Patterns
| Command | Description |
|---|---|
| chmod 777 file | Everyone can read, write, and execute (dangerous!) rwxrwxrwx |
| chmod 755 file | Owner: full access. Group/Others: read and execute rwxr-xr-x — scripts, directories |
| chmod 750 file | Owner: full access. Group: read/execute. Others: none rwxr-x--- — group-shared executables |
| chmod 700 file | Owner: full access. Group/Others: no access rwx------ — private scripts |
| chmod 644 file | Owner: read/write. Group/Others: read only rw-r--r-- — most regular files |
| chmod 640 file | Owner: read/write. Group: read. Others: none rw-r----- — config files |
| chmod 600 file | Owner: read/write. Group/Others: no access rw------- — SSH keys, secrets |
| chmod 400 file | Owner: read only. Group/Others: no access r-------- — read-only secrets |
Symbolic Mode
| Command | Description |
|---|---|
| chmod +x file | Add execute permission for all |
| chmod u+x file | Add execute permission for owner only |
| chmod g+w file | Add write permission for group |
| chmod o-r file | Remove read permission for others |
| chmod -R 755 dir/ | Apply permissions recursively to directory |
Number Reference
| Command | Description |
|---|---|
| 4 = read (r) | Permission to read file contents or list directory |
| 2 = write (w) | Permission to modify file or create/delete in directory |
Frequently Asked Questions
More Cheatsheets
Git Commands Cheatsheet
This cheatsheet covers the 40 most essential Git commands grouped by workflow: setup, staging, branc...
Docker Commands Cheatsheet
This cheatsheet covers 35 essential Docker commands for managing containers, images, volumes, and ne...
Linux Commands Cheatsheet
This cheatsheet covers 40 essential Linux/Unix commands for daily development: file navigation, text...
HTTP Status Codes Cheatsheet
HTTP status codes are 3-digit numbers returned by servers. 1xx = informational, 2xx = success, 3xx =...