Calculate Unix file permissions with an interactive visual grid.
Command
chmod 755 filename
ls -l preview
-rwxr-xr-x 1 user group 0 Mar 7 12:00 filename
Unix permissions are represented as three octal digits (owner, group, others). Each digit is a sum of: Read (4), Write (2), Execute (1). For example, 755 means owner can read/write/execute, while group and others can read/execute.
Tick read, write and execute for the owner, group and others, or type a three-digit octal value. The calculator shows the matching symbolic permissions, an ls -l preview and the command to run.
755 (rwxr-xr-x) suits directories and executable scripts. 644 (rw-r--r--) suits ordinary files. 600 (rw-------) keeps a file private to its owner, and 400 (r--------) is a common choice for SSH private keys. 700 (rwx------) is a private directory or script.
On a file, execute means it can be run as a program. On a directory, execute allows entering it and reaching the files inside, and read allows listing their names. Write permission on a directory allows creating, renaming and deleting entries.
Running chmod -R 755 also makes every ordinary file executable. Use chmod -R u=rwX,go=rX folder instead: the capital X adds execute only to directories and to files that are already executable.
The owner can read, write and execute. The group and others can read and execute.
The owner can read and write. The group and others can only read.
Usually not. It lets every user on the system modify and execute the file. Grant only the access that is needed.
Use 600 or 400 for a private key, so only its owner can read it.