Chmod Calculator
Calculate Linux file permissions in octal and symbolic notation
Permission Matrix
| Role | Read (4) | Write (2) | Execute (1) | Value |
|---|---|---|---|---|
| owneru | 6 | |||
| groupg | 4 | |||
| otherso | 4 |
Octal Notation
Symbolic Notation
# Command Examples
Common Permission Presets
π‘οΈUnderstanding Linux File Permissions
Linux file permissions control who can read, write, and execute files. Every file and directory has three permission sets: one for the owner, one for the group, and one for all other users.
The chmod command (change mode) is used to modify these permissions. You can use either octal notation (like 755) or symbolic notation (like rwxr-xr-x) to set permissions.
Permission Values Explained
Read (r)
View file contents or list directory contents.
Write (w)
Modify file contents or create/delete files in directory.
Execute (x)
Run file as program or enter directory.
Security Best Practices
Special Permissions (Setuid, Setgid, Sticky Bit)
Beyond the basic read, write, and execute permissions, Linux supports special permission bits that modify how programs run or how files are accessed:
Setuid (4xxx)
When set on an executable, it runs with the file owner's permissions. Example: /usr/bin/passwdruns as root to modify /etc/shadow.
Setgid (2xxx)
On files, runs with group permissions. On directories, new files inherit the directory's group instead of the creator's primary group.
Sticky Bit (1xxx)
On directories, only the file owner can delete their files. Used on /tmp to prevent users from deleting each other's temporary files.
Common Permission Scenarios
Web Server Files
HTML/CSS/JS files: 644. Directories: 755. Upload directories may need 775 with proper group ownership.
SSH Keys
Private keys: 600. Public keys: 644. ~/.ssh directory: 700. SSH will refuse to use keys with wrong permissions.
Shell Scripts
User scripts: 755 or 700. System scripts in /usr/local/bin: 755 with root ownership.
Configuration Files
General configs: 644. Sensitive configs with passwords: 600 or 640. Never world-readable for secrets.
Related Tools
JSON Formatter/Validator
Format, validate and beautify JSON data
API Response Formatter
Format and beautify API responses for better readability
Cron Job Generator
Generate cron expressions for scheduled tasks easily
Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and more
HTML Minifier
Minify HTML code by removing comments, whitespace, and optional tags
htaccess Generator
Generate Apache .htaccess files for redirects, security, caching, and more
Code Beautifier
Format and beautify HTML, CSS, JavaScript code
JSON Tree Viewer
Professional JSON tree visualization and editing tool with advanced features
JWT Decoder
Decode and inspect JSON Web Tokens (JWT) with claim explanations
JavaScript Minifier
Minify and compress JavaScript code
SQL Query Builder
Build SQL queries visually with drag-and-drop interface
Git Commands Helper
Interactive Git command generator and reference guide