Umask Calculator with Effective Permissions Preview
<p>A Linux tool for calculating umask values and previewing their effect on file and directory permissions</p>
Umask Calculator
Umask Permission Bits
Checked boxes represent bits that are BLOCKED in new files/directories.
umask 022
Effective Permissions Preview
File Creation (Default: 666)
Directory Creation (Default: 777)
Common Umask Values
What is umask
?
umask
(user mask) is a command in Linux/Unix systems that sets the default permissions for newly created files and directories. It works by "masking out" (removing) certain permission bits from the default permissions.
How Umask Works
When you create a new file or directory, the system starts with default permissions (typically 666 for files and 777 for directories), then subtracts the umask value:
For Files:
Default file permissions (666) minus your umask value gives the actual permissions for new files
For Directories:
Default directory permissions (777) minus your umask value gives the actual permissions for new directories
Understanding Umask Values
Umask uses the same octal notation as chmod, but with opposite meaning:
- 1 blocks execute (x)
- 2 blocks write (w)
- 4 blocks read (r)
For example, umask 022 means "block write and execute for group and others, but don't block anything for owner".
Checking Current Umask
To check your current umask setting:
0022
The leading 0 is sometimes shown but can be omitted when setting the umask.
Common Umask Settings
Umask | File Permissions | Directory Permissions | Description |
---|---|---|---|
022 | 644 (rw-r--r--) | 755 (rwxr-xr-x) | Default on most Linux systems, good balance of security |
002 | 664 (rw-rw-r--) | 775 (rwxrwxr-x) | Good for collaborative environments where group members need write access |
077 | 600 (rw-------) | 700 (rwx------) | Maximum privacy, files accessible only by the owner |
027 | 640 (rw-r-----) | 750 (rwxr-x---) | Group can read/execute but not write, others have no permissions |
007 | 660 (rw-rw----) | 770 (rwxrwx---) | Owner and group have full access, others have none |
Setting Your Umask
Temporary Change
To set umask for your current session only:
Permanent Change
To make your umask change permanent, add it to your shell's startup file:
For Bash:
umask 022
For Zsh:
umask 022
Tips & Best Practices
- The standard umask on most Linux systems is
022
, which is a good balance between security and usability - For sensitive data, consider using a more restrictive umask like
077
- On shared systems where collaboration is important,
002
might be appropriate - Remember that the umask only affects newly created files, not existing ones
- When setting up web servers, the umask may need to be adjusted based on which user runs the web server process
Related Tools
ACL Permission Generator (getfacl/setfacl)
<p>A Linux tool to generate getfacl and setfacl commands for managing Access Control Lists (ACLs) on files and directories.</p>
Chmod Calculator
Calculate file permissions in Linux using a visual interface
Chown Command Generator
<p>A Linux tool to easily generate chown commands for changing file ownership between users and groups</p>
Crontab Generator
Generate cron expressions for scheduled tasks
Docker Volume Permission Helper
<p>A tool to help resolve permission issues between Docker containers and host system volumes with proper user/group mappings.</p>
Effective Permission Calculator (User + Group + Others)
<p>A Linux tool to calculate the effective permissions for a user, considering user, group, and others permissions.</p>
Stay Updated with Linux Tips
Get weekly tutorials, command references, and new tool announcements delivered straight to your inbox.