How to use CHMOD & Common Commands
The chmod (change mode) command controls file and directory permissions in Linux and Unix systems. Use the interactive toggles above to generate the exact permission string you need, then copy the command. Below are some standard configurations used in server environments.
Common Permission Scenarios
Octal (Numeric) Breakdown
Permissions are mathematically calculated by adding the required access values together for each group (Owner, Group, Public).
4= Read (r)2= Write (w)1= Execute (x)0= No Permission (-)
A CHMOD Configurator is a tool for creating and understanding Linux and Unix file permissions. It allows users to select permissions for the owner, group, and others and automatically converts those selections into the corresponding numeric (octal) and symbolic chmod notation.
For example, if a file should allow the owner to read, write, and execute it, while the group and everyone else can only read it, the configurator can generate:
chmod 744 filenameThe tool is useful because Linux permissions are often represented using compact numeric values such as 755, 644, or 700, which can be difficult to remember without understanding how the permission system works.
What Does a CHMOD Configurator Do?
A CHMOD Configurator typically lets you select three types of users:
- Owner (user)
- Group
- Others
For each category, you can enable or disable:
- Read (
r) - Write (
w) - Execute (
x)
The configurator then converts those selections into:
- A numeric permission code, such as
755 - A symbolic permission string, such as
rwxr-xr-x - A complete chmod command, such as:
chmod 755 filenameThis makes it easier to create permissions without manually calculating the octal values.
Understanding Linux File Permissions
Linux permissions determine who can access a file or directory and what they are allowed to do with it.
There are three primary permission classes:
Owner
The owner is the user account that owns the file.
Group
The group represents users belonging to the file’s assigned group.
Others
Others refers to users who are neither the file owner nor members of the file’s group.
Each class can have three basic permissions:
| Permission | Symbol | Numeric value |
|---|---|---|
| Read | r | 4 |
| Write | w | 2 |
| Execute | x | 1 |
These values form the foundation of numeric chmod permissions.
How Numeric CHMOD Values Work
The numeric form of chmod usually contains three digits:
755Each digit corresponds to a permission class:
7 5 5
│ │ │
│ │ └── Others
│ └────── Group
└────────── OwnerEach digit is calculated by adding the values of the enabled permissions.
Read Permission
Read has a value of:
4
Write Permission
Write has a value of:
2
Execute Permission
Execute has a value of:
1
Therefore:
Read + Write + Execute = 4 + 2 + 1 = 7
Similarly:
Read + Write = 4 + 2 = 6
Read + Execute = 4 + 1 = 5
Write + Execute = 2 + 1 = 3
CHMOD Permission Value Table
A CHMOD Configurator commonly uses the following combinations:
| Numeric value | Symbolic permissions | Meaning |
|---|---|---|
| 0 | --- | No permissions |
| 1 | --x | Execute only |
| 2 | -w- | Write only |
| 3 | -wx | Write + execute |
| 4 | r-- | Read only |
| 5 | r-x | Read + execute |
| 6 | rw- | Read + write |
| 7 | rwx | Read + write + execute |
Each digit in a three-digit CHMOD code uses this same table.
Example: CHMOD 755
Consider:
chmod 755 script.shThe three digits mean:
- Owner =
7 - Group =
5 - Others =
5
Convert each digit:
7 = 4 + 2 + 1 = rwx
5 = 4 + 1 = r-x
5 = 4 + 1 = r-x
Therefore:
755 = rwxr-xr-xThe owner can read, write, and execute the file.
The group can read and execute it but cannot modify it.
Others can read and execute it but cannot modify it.
Example: CHMOD 644
A common permission configuration for a regular readable file is:
chmod 644 document.txtThe calculation is:
6 = 4 + 2 = rw-
4 = r--
4 = r--
Therefore:
644 = rw-r--r--The owner can read and modify the file.
The group can read it.
Others can read it.
Example: CHMOD 700
For:
chmod 700 private.shThe permissions are:
7 = rwx
0 = ---
0 = ---
Therefore:
700 = rwx------Only the owner has permissions.
How a CHMOD Configurator Calculates the Numeric Code
The conversion process is simple.
Suppose the selected permissions are:
Owner
- Read ✓
- Write ✓
- Execute ✓
Owner value:
4 + 2 + 1 = 7
Group
- Read ✓
- Write ✗
- Execute ✓
Group value:
4 + 1 = 5
Others
- Read ✓
- Write ✗
- Execute ✗
Others value:
4
The resulting numeric permission is:
754The symbolic representation is:
rwxr-xr--The corresponding command would be:
chmod 754 filenameSymbolic CHMOD Notation
Permissions can also be written symbolically.
For example:
rwxr-xr-xThe string contains three groups:
rwx r-x r-x
│ │ │
│ │ └── Others
│ └──────── Group
└────────────── OwnerThe first character of a complete ls -l permission display may represent the file type.
For example:
-rwxr-xr-xHere:
-indicates a regular filerwx= owner permissionsr-x= group permissionsr-x= others permissions
A directory commonly begins with d, such as:
drwxr-xr-xThe d indicates a directory rather than a regular file.
Symbolic CHMOD Commands
The CHMOD Configurator may also help generate symbolic commands.
For example:
chmod u+x script.shmeans to add execute permission for the owner.
The symbolic user categories are commonly:
| Symbol | Meaning |
|---|---|
u | User/owner |
g | Group |
o | Others |
a | All three classes |
Operators include:
| Operator | Function |
|---|---|
+ | Add permission |
- | Remove permission |
= | Set permissions exactly |
For example:
chmod g+w file.txtadds write permission for the group.
Another example:
chmod o-r file.txtremoves read permission from others.
CHMOD Configurator: Numeric to Symbolic Conversion
A configurator can also work in the opposite direction.
Suppose the input is:
751Convert each digit:
7 = rwx
5 = r-x
1 = --x
Therefore:
751 = rwxr-x--xThis makes it easier to understand what an unfamiliar numeric permission actually allows.
Special Permissions
Some CHMOD configurators also support special permission bits beyond the standard read, write, and execute permissions.
These include:
- Set User ID (SUID)
- Set Group ID (SGID)
- Sticky bit
They are commonly represented using an additional leading numeric digit.
The special permission values are:
| Special permission | Numeric value |
|---|---|
| SUID | 4 |
| SGID | 2 |
| Sticky bit | 1 |
For example, a four-digit mode can contain:
4755The leading 4 represents SUID, while 755 represents the standard owner/group/others permissions.
Because special permissions can affect how programs and directories operate, they should be used deliberately rather than added simply to make a permission string look correct.
CHMOD Permissions for Directories
Permissions have somewhat different practical effects on directories.
For a directory:
- Read generally allows listing directory entries.
- Write generally allows creating, deleting, or renaming entries, subject to other permissions and filesystem rules.
- Execute generally allows accessing/traversing the directory.
For example:
chmod 755 myfolderproduces:
drwxr-xr-xThe owner has full permissions, while group and others can read/list and traverse the directory but cannot normally create or delete entries within it.
Common CHMOD Configurations
Some frequently encountered configurations include:
| Mode | Symbolic form | General use |
|---|---|---|
600 | rw------- | Private file |
644 | rw-r--r-- | Regular readable file |
700 | rwx------ | Private executable/directory |
755 | rwxr-xr-x | Executable file or commonly accessible directory |
775 | rwxrwxr-x | Group-writable file or directory |
777 | rwxrwxrwx | Full permissions for everyone |
These are examples, not universal recommendations. The appropriate permissions depend on the application’s requirements and security model.
Important Security Considerations
File permissions directly affect system security.
Giving unnecessary permissions can allow users or processes to modify, execute, or access files that should be restricted.
For example:
chmod 777 file.txtgrants read, write, and execute permissions to the owner, group, and others. This is substantially broader access than:
chmod 644 file.txtwhich allows the owner to read and write while giving group and others read-only access.
The correct permission depends on the file, application, users, and operating environment. A configurator can accurately calculate the requested permission mode, but it cannot determine the appropriate security policy for every system.
Frequently Asked Questions
What does CHMOD mean?
chmod stands for change mode. It is a Unix/Linux command used to change file and directory permission modes.
What does 755 mean in CHMOD?
755 means:
rwxr-xr-xThe owner has read, write, and execute permissions. The group and others have read and execute permissions.
What does 644 mean?
644 means:
rw-r--r--The owner can read and write, while group and others can read.
What is the numeric value of read permission?
Read is represented by 4.
What is the numeric value of write permission?
Write is represented by 2.
What is the numeric value of execute permission?
Execute is represented by 1.
Why is 7 equal to rwx?
Because:
4 + 2 + 1 = 7
Therefore, 7 represents read, write, and execute.
Can a CHMOD Configurator generate commands?
Yes. A configurator can combine the selected permissions into a command such as:
chmod 755 filenameDoes CHMOD work only on files?
No. chmod can be used with both files and directories. The practical meaning of permissions, particularly execute permission, differs between regular files and directories.
