Support

Permissions

Runs in your browser· a calculator: everything is worked out in this tab

Tick what each class may do
ClassReadWriteExecute
Owner
Group
Others
Special bits

Owner: read, write, execute. Group: read, execute. Others: read, execute.

Command

chmod 755 script.sh

umask

New files get 644 (rw-r--r--), new directories 755 (rwxr-xr-x).

Calculate chmod permissions, octal and symbolic

Work out the chmod number for the permissions you want, or decode a mode you have been given. Tick read, write and execute for the owner, group and others, add setuid, setgid or sticky, and read the octal value (755), the rwx text (rwxr-xr-x), a plain-words summary and a ready-to-copy command. A umask section shows what mode new files and directories get.

Frequently Asked Questions

How does chmod 755 work?
Each digit is the sum of read (4), write (2) and execute (1) for one class, in the order owner, group, others. So 755 means owner 7 (read, write, execute), group 5 (read, execute) and others 5 (read, execute): rwxr-xr-x. It is the usual mode for programs and directories.
What is the difference between chmod 644 and 755?
644 (rw-r--r--) lets the owner read and write and everyone else only read, which suits normal files. 755 (rwxr-xr-x) adds execute for everyone, which programs, scripts and directories need so they can be run or entered.
What do the leading digit and the s and t letters mean?
A fourth, leading digit holds special bits: 4 is setuid (a program runs as its owner), 2 is setgid (runs as its group, or new files in a directory inherit the group) and 1 is sticky (in a shared directory only a file's owner can delete it, like /tmp, mode 1777). In rwx text they show as s or t in the execute place, in capitals when execute is off.
How does umask relate to chmod?
The umask is subtracted from the starting mode of every new file (666) and directory (777). A umask of 022 gives new files 644 and new directories 755. Type a umask in the calculator to see both results.

Found this useful? Hexabench is free and ad-free. If it saved you time, you can support it.

Buy me a coffee →