What chmod 711 means
| Who | Digit | Letters | On a file | On a directory |
|---|---|---|---|---|
| owner | 7 |
rwx |
Can read, modify and run | Can list files, create, delete and rename files and enter it and open files |
| group | 1 |
--x |
Can run | Can enter it and open files |
| others | 1 |
--x |
Can run | Can enter it and open files |
Each digit is the sum of read (4), write (2) and execute (1). In
ls -l output it looks like this:
$ ls -l
drwx--x--x 2 alice staff 4096 Oct 21 10:30 example-dir
- The owner can read, write and execute.
- The group can execute.
- Everyone else can execute.
When to use 711
- Directories others traverse but can’t list
- Binaries that must not be copied
On a directory, 711 lets other users pass through to known paths without being able to list the contents. On a compiled binary, others can run it but can’t read or copy it. Shell scripts are different: the interpreter has to read the file, so a script with 711 fails for everyone but the owner.
Is chmod 711 safe?
Yes, for directories others traverse but can’t list. Other users can execute it, but can’t change it. Don’t use it for files that contain secrets.
Commands
# One file or directory
chmod 711 path
# Same thing in symbolic form
chmod u=rwx,g=x,o=x path
# Every directory under a tree (leaves files alone)
find /path/to/dir -type d -exec chmod 711 {} +
# Check the result
stat -c '%a %A %n' path # Linux
stat -f '%Lp %Sp %N' path # macOS
Avoid chmod -R 711 on a whole tree: it gives files and directories the same mode. The
find form above changes only directories.
Compare with similar modes
| Mode | Symbolic | Difference |
|---|---|---|
751 |
rwxr-x--x |
Lets the owner do everything, the group read and execute, and others only execute |
Other chmod values
777 · 775 · 770 · 755 · 751 · 750 · 744 · 700 · 666 · 664 · 660 · 644 · 640 · 600 · 555 · 500 · 444 · 400 · 000 · 1777 · 2775 · 4755
Need a different combination? Use the Chmod Calculator.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does chmod 711 mean?
chmod 711 sets the permissions to rwx--x--x. The owner can read, write and execute. The group can execute. Everyone else can execute.
Is chmod 711 safe?
Yes, for directories others traverse but can’t list. Other users can execute it, but can’t change it. Don’t use it for files that contain secrets.