chmodcalculator
Command Handbook

Chmod Permissions Handbook & Cheat Sheet

Everything you need to know about setting, modifying, and troubleshooting Linux permissions using both octal notation and symbolic operators.

Quick Permission Calculator

Calculate values instantly
Ready-to-run Linux command
chmod 755 filename

Permission Checkbox Matrix

Click any permission to recalculate instantly
User / Owner (u)
File creator / owner
Total:7
Group (g)
Assigned user group
Total:5
Others / Public (o)
All other system users
Total:5
4thAdvanced / Special Permissions (SUID, SGID, Sticky Bit)
Dynamic Permission Translation
Owner:Read, Write, Execute (Full access)
Group:Read, Execute
Others:Read, Execute
File vs Directory Semantics

For Files: x allows binary or script execution.
For Directories: x is the search/traverse bit, required to cd into the directory and access inner files. Without directory execute, users cannot open subdirectories even with read rights!

Quick Permission PresetsClick to apply
Copied to clipboard

1. Octal vs Symbolic Command Syntax

The chmod command supports two distinct syntax paradigms:

Octal / Numeric Mode

Replaces all permissions on the target file with the exact octal mask specified.

chmod 755 script.sh
chmod 644 document.txt
chmod 600 id_rsa

Symbolic Mode Operators

Modifies permissions incrementally using operators: + (add), - (remove), = (set explicitly).

chmod +x script.sh
chmod u=rw,go=r file.txt
chmod g-w,o-rwx secret.key

2. Essential Chmod Command Flags

FlagNameFunction
-R, --recursiveRecursiveChange files and directories recursively across all subfolders.
-v, --verboseVerboseOutput a diagnostic message for every file processed.
-c, --changesChanges OnlyLike verbose, but reports only when a change is actually made.
-f, --silentQuietSuppress most error messages (e.g. permission warnings on protected files).

3. Real-World Production Recipes

Web Application Directory Setup (WordPress, Laravel, Node)

Safely set directories to 755 and static files to 644 without breaking folder traversal:

sudo chown -R www-data:www-data /var/www/site
sudo find /var/www/site -type d -exec chmod 755 {} +
sudo find /var/www/site -type f -exec chmod 644 {} +

Git Hooks & CI/CD Scripts

Ensure shell scripts and git hooks are executable by the owner:

chmod +x .husky/pre-commit
chmod 755 scripts/deploy.sh

Lock Down Cloud & Server Secrets

Prevent non-owner processes from reading production API keys and database credentials:

chmod 600 .env .env.production
chmod 600 ~/.ssh/id_ed25519
chmod 700 ~/.ssh