Chmod Calculator

Visualize and understand Unix/Linux file permissions instantly.

Owner (User)

Group

Public (Other)

Octal
755
Symbolic
rwxr-xr-x

Command: chmod 755 <filename>

What is `chmod`?

chmod (short for "change mode") is a command in Unix and Unix-like operating systems that changes the access permissions of file system objects (files and directories). It controls who can read, write to, or execute a file.

Understanding File Permissions

Permissions are defined for three classes of users:

  • Owner/User: The user who owns the file.
  • Group: The group that owns the file. Users in this group share permissions.
  • Other (or Public): All other users on the system.

For each class, one or more of the following permissions can be granted:

  • Read (r): Allows viewing the contents of a file or listing the contents of a directory.
  • Write (w): Allows modifying a file, or creating/deleting files within a directory.
  • Execute (x): Allows running a file as a program or entering (cd-ing into) a directory.

Numeric (Octal) Notation

Permissions can be represented by a three-digit octal number. Each digit corresponds to a user class (Owner, Group, Other), and its value is the sum of its permissions:

  • 4 = Read
  • 2 = Write
  • 1 = Execute

For example, a value of 7 (4+2+1) grants Read, Write, and Execute permissions. A value of 5 (4+0+1) grants Read and Execute permissions.

Common `chmod` Examples

OctalSymbolicDescription
755rwxr-xr-xOwner has full access. Group and Others can read and execute. Common for web servers and scripts.
644rw-r--r--Owner can read and write. Group and Others can only read. Common for web files like HTML.
777rwxrwxrwxEveryone can read, write, and execute. Often insecure and should be used with caution.
600rw-------Only the Owner can read and write. Very restrictive, good for sensitive files.

The Complete Guide to chmod and Linux File Permissions

If you deploy applications to modern servers, write bash scripts, or manage web hosting, you will inevitably encounter the venerable chmod command. Short for "change mode", it is the undisputed gatekeeper of Unix and Linux file system security. It dictates exactly who is allowed to read your data, write to your files, or execute your programs. Our visual calculator helps you translate complex access grids into the 3-digit octal codes required by the terminal.

Understanding the Three User Classes

Every single file and directory on a Linux machine belongs to an ownership structure. Permissions are explicitly defined across three distinct tiers or "classes" of users:

1. Owner (User)

The primary user account that originally created or currently owns the file system object. Typically, the owner has the highest level of access.

2. Group

A designated collection of multiple users. If a file is assigned to the 'dev-team' group, anyone belonging to 'dev-team' inherits these specific permissions.

3. Others (Public)

Everyone else on the system. This corresponds to the entire world—meaning any user account that is neither the owner nor part of the group.

The Three Permission Types

For each of those three user classes, you can grant or deny three fundamental capabilities:

  • Read (r)For Files: Allows the user to view the contents of a file (like opening a .txt or reading code).
    For Directories: Allows the user to list the names of the files inside the folder (like running the ls command).
  • Write (w)For Files: Allows the user to edit, append, or overwrite the file.
    For Directories: Allows the user to create new files, delete existing files, and rename files inside the folder. (Note: Deleting a file actually requires Write permission on its parent directory, not the file itself!).
  • Execute (x)For Files: Allows the user to forcefully run the file as an application or executable script (.sh, .bin, etc).
    For Directories: Allows the user to actually enter the directory (running the cd command) and access the data inside it. Without directory execute permission, read and write are useless.

How Numeric (Octal) Notation Works

While you can use symbolic commands (like chmod u+x file.sh), professional sysadmins use the much faster 3-digit octal number format. Each digit represents a user class (Owner, Group, Other). The digit itself is calculated by adding up the corresponding values of the granted permissions:

4Read
2Write
1Execute

For example, if the Owner needs Read (4), Write (2), and Execute (1), their digit is 7 (4+2+1). If the Group only needs Read (4), their digit is 4. If Others get nothing, their digit is 0. Thus, the final command is chmod 740.