Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

chmod 644 file gives the owner read and write access while allowing the group and everyone else to read; chmod 755 script also lets the group and others execute the file. The digits are octal permission sums, read in owner–group–other order. A fourth digit, when used, represents special bits rather than another user category.

How to read a three-digit chmod mode

In an ordinary numeric mode, the first digit sets permissions for the file’s owner, the second for users in the file’s group, and the third for everyone else. Each digit adds the permission values it includes:

Value Permission
4 Read
2 Write
1 Execute for files; search/traverse for directories

Add the values to form each digit: 7 is 4+2+1 (read, write, execute/search); 6 is 4+2 (read and write); 5 is 4+1 (read and execute/search); and 4 is read only. GNU Coreutils documents numeric modes as octal: “Numeric modes are always interpreted in octal; you do not have to add a leading ‘0’, as you do in C.” This is the rule in the GNU Coreutils 9.11 manual, “Numeric Modes”.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What 644 and 755 allow

Mode Owner Group Other users Typical effect on a regular file
644 Read, write Read Read Owner can edit; others can read, but cannot execute
755 Read, write, execute Read, execute Read, execute Owner can edit and execute; others can read and execute

For example, chmod 644 file applies mode 644, while chmod 755 script applies mode 755. GNU’s chmod invocation documentation uses chmod 644 foo as an example of making a file readable by everyone while retaining owner write access.

Why execute means something different on a directory

On a regular file, execute allows an eligible user to run it as a program, subject to other system requirements. On a directory, execute permission means search or traversal: it lets a user access entries within the directory when they know the relevant names and have the needed permissions. Read permission on a directory allows listing its contents; write permission allows creating or removing entries, subject to applicable rules.

So 755 on a directory means its owner can read, write, and search it, while group members and other users can read and search it. It does not mean they can execute the directory like a program. GNU describes these distinctions in its mode structure documentation.

What a fourth digit means

A four-digit mode begins with special mode bits, followed by the ordinary owner, group, and other digits. The leading digit combines these values:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Leading value Special bit
4 Set-user-ID
2 Set-group-ID
1 Sticky (restricted deletion)

For example, 4751 includes set-user-ID along with ordinary permissions 751. Special-bit effects depend on the file type and system. On most systems, set-group-ID on a directory causes new entries to inherit the directory’s group, and new subdirectories to inherit set-group-ID. A directory’s sticky bit restricts who may remove or rename entries: users generally need to own the entry or the directory, or have appropriate privileges. See GNU’s directory setuid and setgid documentation.

Does chmod replace permissions or add to them?

A plain numeric mode such as chmod 644 file sets the specified permission bits absolutely; it does not mean “add read permission” to the current mode. GNU also supports operator numeric modes such as +440, -1, and =600, which modify bits using an operator. The GNU Coreutils 9.11 manual states: “Operator numeric modes are a GNU extension.” Do not assume these operator forms are portable to other implementations. GNU also documents that chmod =755 dir and chmod 755 dir differ in how they affect set-user-ID and set-group-ID bits on directories. Details are in “Operator Numeric Modes” and “Directory Setuid and Setgid”.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Apply a mode carefully

  1. Choose the target and intended access. Decide which of owner, group, and other users should read, write, or execute/search. There is no universally correct mode; the right one depends on the object and who needs access.
  2. Check the command’s scope. A command-line symbolic-link argument normally changes the target’s permissions under GNU chmod. Recursive traversal treats links differently, as described in the GNU chmod invocation documentation.
  3. Use a plain mode for an explicit setting. For example, chmod 644 report.txt sets the regular file’s mode to owner read/write and group/other read, assuming you have permission to change it.
  4. Inspect before using recursion. A recursive command can affect many files and directories beneath its target. Confirm the exact directory and contents before using an option such as -R; do not run it against a broad path unless that broad change is intended.

Changing permissions generally requires owning the file or having appropriate privileges. A command may fail if the invoking process lacks those rights, even when the numeric mode is valid.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.