Free tool

chmod permissions calculator

Tick the boxes or type a number like 755 to see what the permissions mean and the exact command to set them.

ReadWriteExecute
Owner
Group
Others

How the numbers work

Each digit covers one set of people: the owner, the file's group, then everyone else. Inside a digit, read counts 4, write counts 2 and execute counts 1, and you add up the ones you want. So 6 is read and write (4 + 2), 5 is read and execute (4 + 1), and 7 is all three.

On a directory the same letters mean slightly different things: read lets you list the names inside, write lets you create and delete entries, and execute lets you enter the directory and reach the files in it.

Common settings

  • 644 rw-r--r--

    Normal files: you edit, everyone else reads.

  • 600 rw-------

    Private files such as SSH keys: only you.

  • 755 rwxr-xr-x

    Programs, scripts and ordinary directories.

  • 700 rwx------

    Private directories and personal scripts.

  • 664 rw-rw-r--

    Files shared with your group.

  • 775 rwxrwxr-x

    Directories shared with your group.

Avoid 777 and 666: they let any user on the machine change the file, which is almost never what you want.

What will new files get? (umask)

New files start from 666 and new directories from 777, then the bits in your umask are taken away. Type a umask to see the result.

Looking for other commands? See the Linux command cheat sheet or the cron schedule explainer.