Interactive Unix file permission calculator. Toggle permissions visually or enter an octal number. Get the chmod command instantly.
| Value | Permission | Description |
|---|---|---|
| 4 | r-- | Read — view file contents or list directory |
| 2 | -w- | Write — modify file or create/delete in directory |
| 1 | --x | Execute — run file or access directory |
| 5 | r-x | Read + Execute |
| 6 | rw- | Read + Write |
| 7 | rwx | Read + Write + Execute (full access) |
| 0 | --- | No permissions |
Cron Expression Generator, Regex Tester, Password Generator, and 30+ more tools.
Browse All Tools →Unix/Linux file permissions control who can read, write, and execute files. The chmod command changes these permissions using either numeric (octal) or symbolic notation.
Each permission is represented by a number: Read (4), Write (2), Execute (1). These are added together for each class (owner, group, others):
chmod 755 myfile.sh # Owner: 7 = 4+2+1 = rwx (read, write, execute) # Group: 5 = 4+0+1 = r-x (read, execute) # Others: 5 = 4+0+1 = r-x (read, execute)
Uses letters to represent who and what:
# Add execute for owner chmod u+x script.sh # Remove write for group and others chmod go-w file.txt # Set exact permissions chmod u=rwx,g=rx,o=r file.txt
chmod 755 gives the owner read, write, and execute (7), while the group and others get read and execute (5). It is the standard permission for web directories and executable scripts. The owner can modify the file; everyone else can read and run it. It is commonly used for web server document roots, PHP files, and shell scripts.
Octal notation uses three-digit numbers (e.g., 755) where each digit represents owner, group, and others permissions. Symbolic notation uses letters like u+rwx or go-w to add or remove specific bits. Octal is faster to type once learned; symbolic is more readable and lets you modify specific permissions without knowing the current state. Both achieve the same result.
chmod 777 grants read, write, and execute to everyone — owner, group, and all other users. It is dangerous on shared servers because any user or process can modify or execute the file. Never use 777 in production. Use 644 for web files (owner write, everyone read) or 755 for directories and scripts that need to be executed by the web server.
Use chmod -R mode directory to apply permissions recursively to all files and subdirectories. For example, chmod -R 755 /var/www/html sets 755 on all contents. Be careful: recursive chmod applies the same mode to files and directories alike, but you usually want 644 for files and 755 for directories. Use find with -exec chmod for more precise per-type control.
Linux permissions are split into three groups: owner (u), group (g), and others (o). The owner created the file; the group is a set of users with shared access; others refers to all remaining users. Each group has three bits: read (r=4), write (w=2), and execute (x=1). Add the values together — 4+2+1=7 means full permissions for that group.