chmod 550 r-xr-x---

chmod 550 (r-xr-x---): the owner can read and execute, the group read and execute, others do nothing. Typical use: read-only programs shared with a group.

Octal
550 (also written 0550)
Symbolic
r-xr-x---
ls -l shows
-r-xr-x--- for a file, dr-xr-x--- for a directory
chmod letters
u=rx,g=rx,o=

Who can do what

ClassDigitBitsOn a fileOn a directory
Owner (u)5r-xRead the contents and run it as a programList the names inside and enter it and open files by name
Group (g)5r-xRead the contents and run it as a programList the names inside and enter it and open files by name
Others (o)0---NothingNothing

Each digit adds read (4), write (2) and execute (1). Deleting or renaming a file depends on write and execute on the directory that holds it, not on the file's own mode. Root bypasses read and write checks.

Typical uses

The owner and the group can read and execute, nobody can write. A good fit for deployed application code that a service account runs but must not modify, or a directory shared read-only with a team.

Security notes

  • Only the owner (and root) can change it; the group and others are limited to the read and execute rights shown above, which is the usual safe pattern for shared files and directories.

Commands

  • Numeric
    chmod 550 file
  • Symbolic
    chmod u=rx,g=rx,o= file
  • Check the result
    stat -c '%a %A %n' file
  • Directories only, recursively
    find /path -type d -exec chmod 550 {} +

Avoid chmod -R 550 on a tree that holds files as well as folders: it makes every file executable. Use the find command above for directories and a file mode such as 440 for the files.

The umask that gives 550

  • umask 227: new directories are created as 550 (and files as 440)

Programs create files with 666 and directories with 777, and the umask removes bits from those. A umask never adds execute to a new file, and it cannot set setuid, setgid or the sticky bit.

Its file counterpart is chmod 440 (r--r-----).

Other common modes

Work out any other mode in the chmod calculator