Chmod Octal & Symbolic Calculator
POSIX IEEE 1003.1Convert between octal modes (0755, 0600) and symbolic notation (-rwxr-xr-x) with special SUID, SGID, and Sticky bits.
1. Interactive POSIX Permission Matrix
2. Target File Path & CLI Options
# 1. Apply Octal Permission Mode (755)
chmod 755 /var/www/html/app.sh
# 2. Equivalent Symbolic Mode Command
chmod u=rwx,g=rx,o=rx /var/www/html/app.sh
# 3. Verify Inode Permissions with stat(1)
stat -c "%a %A %U:%G %n" /var/www/html/app.sh
# Expected File Output : 0755 -rwxr-xr-x
# Expected Dir Output : 0755 drwxr-xr-x
# 4. Separate Directory (755) & File (644) Hardening One-Liner
find /var/www/html/app.sh -type d -exec chmod 0755 {} +
find /var/www/html/app.sh -type f -exec chmod 0644 {} +Avoid running chmod -R 777 on web roots. Use 0755 for directories and 0644 for static assets.
POSIX File Mode Bits (IEEE Std 1003.1) & Octal Bitmask Arithmetic
In Unix, Linux, and macOS filesystems, every inode stores a 16-bit st_mode field defined by POSIX.1 (IEEE Std 1003.1). The lower 12 bits control access permissions across three security classes—User (Owner), Group, and Others (Public)—alongside three high-order special execution bits (S_ISUID, S_ISGID, and S_ISVTX).
Octal Bit Values (4, 2, 1)
Each permission triad is represented as a single base-8 digit by summing three binary bit flags: Read (4 = 2²), Write (2 = 2¹), and Execute (1 = 2⁰). Combining Read + Write + Execute yields 4 + 2 + 1 = 7, while Read + Execute yields 4 + 0 + 1 = 5.
Special Mode Bits: Setuid (4000), Setgid (2000) & Sticky (1000)
Setting Setgid (2000) on a shared directory forces newly created files inside it to inherit the directory's group ID rather than the creator's primary group. Setting the Sticky Bit (1000) on world-writable directories like /tmp (1777) prevents unprivileged users from deleting or renaming files owned by other users.