Skip to content
gohacks.dev
Tooling

chmod Calculator

Tick read, write and execute for owner, group and others to get the octal mode, the rwx string and the chmod command.

Free · No sign-up · Your inputs stay in your browser

Input

Work out chmod permissions

ReadWriteExecute
Owner
Group
Others

Output

755 is rwxr-xr-x

Command

chmod 755 path/to/file

Symbolic

rwxr-xr-x

As ls -l prints it, without the leading file-type character. A capital S or T means the special bit is set without execute.

How the digits add up

Each digit is the sum of read (4), write (2) and execute (1). 755 gives the owner 7 (4+2+1, everything) and the group and others 5 (4+1, read and execute). 644 is the usual mode for files and 755 for directories and scripts.

Laravel storage permissions

The web server user needs to write to storage and bootstrap/cache. The fix is to give that user the group and use 775 for directories and 664 for files, not 777, which lets every account on the machine change your application.

The special bits

Setuid (4000) runs an executable as its owner, setgid (2000) on a directory makes new files inherit its group, and the sticky bit (1000) on a directory such as /tmp stops users deleting each other's files.

Share

Frequently asked questions

What does chmod 777 do?
It gives every user on the system read, write and execute permission. It is almost never the right fix; set the correct owner or group instead.
Why does execute matter on a directory?
On a directory, execute means permission to enter it and reach the files inside. Without it, read only lets you list the names.

Keep planning

Similar tools