umask Value Calculator
Work out umask value instantly with clear inputs, formula shown and shareable results.
About umask Value Calculator
umask removes permission bits from a base mode rather than setting them. Files start at 666 and directories at 777 — the execute bit is never granted to new files — and umask bits are cleared from that base. A umask of 022 therefore yields 644 for files and 755 for directories, which is the common default.
Formula
umask application
resulting mode = base mode AND NOT umask; base is 666 for files and 777 for directories
Worked example
With the default values below, umask Value Calculator returns Resulting permissions of 644. Change any input above and every figure here is recalculated in your browser.
Inputs used
- umask valueone of 022 - group and other read only, 027 - group read, no other access, 077 - owner only, 002 - group writable, 007 - group writable, no other access
- 022 - group and other read only
- Object being createdone of Regular file (base 666), Directory (base 777)
- Regular file (base 666)
Results
- Resulting permissions
- 644
- Symbolic form
- rw-r--r--
- Base mode before masking
- 666 (regular file)
- umask applied
- 022
Step by step
- 1Values used
- 2umask application
- 3Resulting permissions= 644
- 4Symbolic form= rw-r--r--
- 5Base mode before masking= 666 (regular file)
- 6umask applied= 022
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why do new files never get the execute bit?
Because the base mode for files is 666. Making every new file executable would be dangerous, so execute must be added explicitly with chmod.
Which umask should a shared project directory use?
002 or 007 with a setgid directory, so group members can write each other's files. 027 or 077 suit private or sensitive data.
Related Calculators
- Account Lockout Policy Calculator
- Backup Size With Retention Calculator
- Bare Metal Sizing Calculator
- Bash Script Runtime Calculator
- Block Size Overhead Calculator
- Compression Ratio Savings Calculator
- Container vs VM Overhead Calculator
- Context Switch Rate Calculator
- CPU Steal Time Impact Calculator
- CPU Utilisation Calculator
You might also need
- Container vs VM Overhead CalculatorAlso in Linux & System Administration
- CPU Utilisation CalculatorAlso in Linux & System Administration
- Free Memory Estimate CalculatorAlso in Linux & System Administration
- Group Quota CalculatorAlso in Linux & System Administration
- Journal Size CalculatorAlso in Linux & System Administration
- LVM Sizing CalculatorAlso in Linux & System Administration
