TR

Home / Guides / What Is chmod? Linux File Permissions 755, 644 and 777 Explained: Reading ls -l, umask and Examples

What Is chmod? Linux File Permissions 755, 644 and 777 Explained: Reading ls -l, umask and Examples

Updated: November 6, 2026 · AracMerkezi

▶ Open Chmod Calculator

On Linux and Unix systems (including macOS and most web servers), every file and folder has permissions that decide who can do what. The chmod command changes these permissions. Permissions are mostly written as three-digit numbers such as 755 or 644. In this guide we explain where the numbers come from, how to read the letter string in ls -l output, the umask value that sets the default permission of new files, and the special bits. We ran all the commands below in a temporary folder and verified their output with stat.

Three user classes, three permission types

PermissionSymbolValueOn a fileOn a folder
Readr4Reads the contentLists what is inside
Writew2Changes the contentAdds and deletes files inside
Executex1Runs it as a programEnters it (cd)

A digit is the sum of the permission values of that class. 7 = 4 + 2 + 1 (rwx), 6 = 4 + 2 (rw-), 5 = 4 + 1 (r-x), 4 = r--, 0 = ---. Without x on a folder you cannot enter it; that is why folders generally use values with x, such as 755.

Reading ls -l output

An ls -l line starts with ten characters like -rwxr-xr--. The first character is the type (- file, d folder), and the next nine characters, in groups of three, are the permissions of the owner, the group and others.

Example 1: -rwxr-xr--

  1. Owner: rwx → 4 + 2 + 1 = 7
  2. Group: r-x → 4 + 0 + 1 = 5
  3. Others: r-- → 4 + 0 + 0 = 4
  4. The numeric equivalent is 754. A file created with chmod 754 really does show up in ls as -rwxr-xr--.

Example 2 (the reverse): 640 is requested. 6 = rw-, 4 = r--, 0 = ---; symbol form: rw-r-----. The owner reads and writes, the group only reads, and others can do nothing.

Common permissions

NumberSymbolUse
755rwxr-xr-xFolders and executable files
644rw-r--r--Website files, plain text
640rw-r-----A file shared with the group, closed to everyone else
600rw-------Private keys (e.g. SSH)
700rwx------A folder only the owner will access
777rwxrwxrwxFull access for everyone (avoid)

Example 3: Fixing a site folder accidentally set to 777

Say everything in a website folder (site) was opened with chmod -R 777. The right fix is to give folders and files permissions separately:

We ran these two commands on a test folder that had been opened with 777: site and site/css came out 755, and site/index.html and site/css/s.css came out 644. Doing chmod -R 755 in one command makes files executable for no reason; two commands preserve the distinction. If you have executable scripts, mark them afterward one by one with chmod +x.

Symbolic mode: letters instead of numbers

chmod does not only take numbers; it also uses u, g, o, a (all) with the +, -, = operations. This makes it easy to change one thing while keeping the existing permissions.

umask: why are new files 644?

The permission of a newly created file is set by the umask mask. Files start from 666 and folders from 777, and the bits in the mask are removed. The values verified by experiment:

umaskNew fileNew folder
022644755
077600700
002664775

022 is the default on most distributions, which is why you see "new file 644, folder 755". If you work with a shared group, 002 lets the group write.

Special bits: the fourth digit

In addition to the three digits, a leading digit carries the special bits: 4 = setuid, 2 = setgid, 1 = sticky. chmod 4755 program makes the file rwsr-xr-x (whoever runs it runs with the owner's privileges); chmod 2755 makes the group s; and chmod 1777 gives rwxrwxrwt, which in shared directories (like /tmp) lets everyone write while preventing deleting someone else's file. These bits are sensitive for security; do not set them without knowing why they are needed.

Common mistakes

Security tips

Mini glossary

To convert a number to rwx or rwx to a number, use the Chmod Calculator. To see it at the binary level, you can look at the Number Base Converter and the guide Binary, Decimal and Hexadecimal Number Systems.

Frequently asked questions

What does 755 mean?

The owner can read, write and execute; the group and others can read and execute (rwxr-xr-x).

Which permission is suitable for website files?

Generally 644 for files and 755 for folders; also check your hosting provider's documentation.

Why is 777 not recommended?

It gives write permission to everyone, which creates a security risk; the narrowest permission needed (644, 755, 600) should be given instead.

Tools mentioned in this guide

More guides

This article is for general information only and is not legal, financial or medical advice. We are not an official institution.