Unix File Permissions Explained - Octal Mode Decoder

Understand Unix/Linux file permissions. Enter any octal mode and see what each digit means in human-readable format.

-rw-r--r--

Owner (6)

read
write
execute

Group (4)

read
write
execute

Others (4)

read
write
execute
0
---
No permissions
1
--x
Execute only
2
-w-
Write only
3
-wx
Write + Execute
4
r--
Read only
5
r-x
Read + Execute
6
rw-
Read + Write
7
rwx
Full permissions

How Unix Permissions Work

Every file and directory in Unix/Linux has permissions that determine who can read, write, or execute it. These permissions are represented as a 3 or 4 digit octal number, where each digit controls a different user category.

The Three Categories

  • Owner: The user who owns the file (first digit)
  • Group: Users in the file's group (second digit)
  • Others: Everyone else on the system (third digit)

Permission Values

  • 4: Read permission (r)
  • 2: Write permission (w)
  • 1: Execute permission (x)
  • 0: No permission (-)

Add values together: 4+2+1=7 (rwx), 4+2=6 (rw-), 4+1=5 (r-x)

Common Permission Patterns

  • 755: Owner full, others read/execute (scripts, programs)
  • 644: Owner read/write, others read (documents)
  • 600: Owner read/write only (private files, SSH keys)
  • 777: Everyone full access (avoid for security)

Setting Permissions

chmod 755 script.sh    # Octal
chmod u+rwx,go+rx file # Symbolic
ls -la                 # View permissions