About Chmod Calculator
Our free online chmod calculator helps you understand and calculate Linux file permissions. Convert between numeric (octal) and symbolic notation, use preset values, and generate chmod commands instantly. Perfect for system administrators, developers, and anyone working with Linux/Unix systems.
Understanding Linux File Permissions
Linux file permissions control who can read, write, and execute files and directories. Every file has three sets of permissions: for the owner, the group, and others. Chmod (change mode) is the command used to modify these permissions.
Permission Basics
- Read (r): Value 4 - Permission to read file contents or list directory contents
- Write (w): Value 2 - Permission to modify file contents or create/delete files in directory
- Execute (x): Value 1 - Permission to execute file or access/traverse directory
Understanding Chmod Numbers
Chmod uses three digits (0-7) representing Owner, Group, and Others respectively. Each digit is calculated by adding the values of the permissions you want to grant:
- 7 (rwx): Read + Write + Execute (4+2+1)
- 6 (rw-): Read + Write (4+2)
- 5 (r-x): Read + Execute (4+1)
- 4 (r--): Read only (4)
- 3 (-wx): Write + Execute (2+1)
- 2 (-w-): Write only (2)
- 1 (--x): Execute only (1)
- 0 (---): No permissions (0)
Common Chmod Values
- 755 (rwxr-xr-x): Owner full permissions, group and others can read and execute. Common for directories and scripts.
- 644 (rw-r--r--): Owner can read/write, group and others can read only. Common for regular files.
- 777 (rwxrwxrwx): Everyone has all permissions. Use with caution for security.
- 600 (rw-------): Owner full permissions, group and others have no access. For sensitive files.
- 700 (rwx------): Owner can do everything, group and others cannot access. For private directories.
- 400 (r-------): Owner can read only. For read-only important files.
Symbolic Notation
Symbolic notation uses letters to represent permissions: u (user/owner), g (group), o (others), a (all). Examples:
chmod u+rwx,g+rx,o+rx file - Set 755 permissions
chmod u+rw,g+r,o+r file - Set 644 permissions
chmod a+x file - Add execute permission for all
chmod o-r file - Remove read permission for others
Security Best Practices
- Use restrictive permissions by default, only grant what's necessary
- Executable scripts should be 755 or 700 depending on who needs to use them
- Sensitive files should be 600 or 400 to prevent unauthorized access
- Avoid using 777 permissions except when absolutely necessary
- Regularly audit file permissions on production systems
- Use recursive chmod (-R) carefully on directories