Owner can read, write and execute. Group can read and execute. Others can read and execute.
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | – | ✓ |
| Others | ✓ | – | ✓ |
Typical use
Scripts, programs and folders that others may open.
Good to know
755 (rwxr-xr-x) is the standard mode for folders and executables: the owner can change them, everyone else can read and run them. On a folder, x means the right to enter it and reach files inside by name, while r only allows listing names. Without x on every parent folder, nobody can reach a file, however readable the file itself is.
New folders usually get 755 automatically, because mkdir starts from 777 and the common umask 022 removes write for group and others. Web servers need at least x on every folder along the path to the document root. Don’t run chmod -R 755 on a whole tree: it marks every file executable. Set folders and files separately with find -type d and find -type f.
Commands
| Set the mode | chmod 755 file |
|---|---|
| The same with letters | chmod u=rwx,g=rx,o=rx file |
| A folder and everything in it | chmod -R 755 folder |
| Only the folders inside | find folder -type d -exec chmod 755 {} + |
| How ls -l shows it | -rwxr-xr-x |