chmod 544
chmod 544 sets r-xr--r--: the owner can read and run the file but not modify it, and the group and everyone else can only read it.
Permission matrix
| Who | Read (4) | Write (2) | Execute (1) | Digit |
|---|---|---|---|---|
| Owner (u) | Yes | No | Yes | 5 |
| Group (g) | Yes | No | No | 4 |
| Others (o) | Yes | No | No | 4 |
Execute means different things by type. On a file it lets the kernel run it as a program. On a directory it is search permission: entering it (cd) and reaching the files inside by name. Read on a directory only lists names.
| Who | On a file | On a directory |
|---|---|---|
| Owner (u) | Read and run | List, enter and open entries |
| Group (g) | Read the contents | List names only; cannot enter or open entries |
| Others (o) | Read the contents | List names only; cannot enter or open entries |
Facts
| Octal | 544 (0544) |
|---|---|
| Symbolic | r-xr--r-- |
| ls -l, file | -r-xr--r-- |
| ls -l, directory | dr-xr--r-- |
| Equivalent symbolic command | chmod u=rx,go=r |
| Default umask that creates it | None of the common umasks; set it explicitly with chmod |
| How Git records a file with it | 100755 (executable) |
| Special bits | None |
When to use it
- Deployed scripts that the owning service account runs and that should be replaced by a new deploy, not edited in place.
- It is 744 with the owner write bit removed, which is what chmod u-w on a 744 file gives you.
When not to use it
- Directories: group and others get read without execute, so they see names but cannot open anything.
- As secrecy: the group and others can read the file and run it through its interpreter (sh healthcheck.sh).
- When the owner must update the file often: every edit needs a chmod first.
Commands
chmod 544 healthcheck.sh
chmod u=rx,go=r healthcheck.sh # same resultstat -c '%a %A %n' healthcheck.sh # Linux (GNU stat): 544 -r-xr--r--
stat -f '%Lp %Sp %N' healthcheck.sh # macOS and BSDApplying it to a whole tree
There is no sensible recursive form of 544: directories would become listable but not enterable for group and others. Apply it to individual scripts.
Git and the execute bit
Git stores only one permission fact per file: 100755 if the owner execute bit is set, 100644 otherwise. A file with this mode is committed as 100755; the group and others bits never reach the repository. On Windows, or where core.fileMode is false, set the bit with git update-index --chmod=+x.
Frequently asked questions
- What does chmod 544 mean?
- Owner 5 (r-x), group 4 (r--), others 4 (r--).
- Can the owner edit a 544 file?
- Not directly; writes fail. The owner can run chmod u+w first.
- What is the difference between 544 and 744?
- Only the owner write bit. 744 lets the owner edit the script, 544 does not.
Last reviewed by Arielton Oberek.