Jan, 28 2022


CHMOD Calculator

Calculate the octal values to set permissions for files and folders in Linux!

Select the required permissions below:

User (Owner) Rights(u)Group Rights(g)Others Rights(o)
Read (4)
Write (2)
Execute (1)

Then, copy the result to your Linux terminal:

Your Octal CHMOD Command:


Common symbolic commands

#Symbolic CommandDescription
1chmod a+r file.extGive everyone - read permission.
2chmod a+w file.extGive everyone - write permission.
3chmod a+x file.extGive everyone - execute permission.
4chmod ug+x file.extGive the user and group - execute permission.
5chmod o-x file.extRemove from the other users - execute permission.
6chmod go+r file.extGive to the group, and others - read permission.

Frequently Asked Questions

Chmod is a system call and command used in UNIX operating systems. Chmod allows you to change the access permissions of files and directories (modes). This command is derived from the phrase "change mode". It is also used in changing special modes such as a sticky bit, setgid and setuid flags. This command is often combined with symbols or digits. These form a syntax representing specific permissions such as read, write and execute.
Read, write and delete are operations used in computer programming. Alternate words such as create, construct, destroy, and can be used. In UNIX, write means to create data, read means to access data, while delete is to destroy the data.
Permissions are set in three or four digits. There are four groups (user, special, group, and other). These groups are then assigned three types of permissions. These are Read, Write and Execute. Each permission is assigned a number 4, 2, or 1. Zero represents no permissions. The value are based on: Read (r) = 4, Write (w) = 2, Execute (x) = 1 and no permission = 0.

What are the Bad chmod settings?

Bad chmod settings refer to granting the wrong permissions to a group. For example, mode 777 means anyone can read, write or execute this file. That's bad news if a hacker can gain access to your system. Also, 777 wipes out the setguid and setuid bits, which some applications depend on. In general, unless needed, do not use chmod 777.
The most common chmod setting is chmod 755. It gives everyone read and executes access, while only the owner can write to the file. Another common command is the chmod 666. This one grants all users permission to read and write files. Chmod 644 allows the owner to read and write files while others can only read the file. Lastly, the chmod 777 is used to grant all users all permissions to directories, and is insecure!

What are the common chmod command examples?

chmod u=rw: It changes the permissions of a file so that the owner can read or write it. But it does not change the permissions of other groups.

chmod u+s: This command changes the permission of a file so that everyone can access it as the owner.

chmod u-s: This unsets the above command.

chmod 644: Sets the permissions of a file to allow the owner to read and write but the group and others to read-only

chmod -R 755: Changes the permissions of a directory and its subdirectories recursively to assume mode 755. The user is granted all permissions, but others can only read and execute.

chmod 666: This command sets the permissions that allow everyone to read and write.

chmod a=rw: it works the same as the above command. The difference is only the symbolic notation.
You can make chmod recursive by using the -R option. A recursive chmod changes permissions to a directory together with all its subdirectories. To change the ownership of the main directory alongside its subdirectories, use the command chgrp -R new_group directory. Chmod command works similarly every time you want to change permissions. For example, to apply the command 755, put it as a prefix chmod -R 755 /path/to/directory.

How do I change chmod permissions in Linux? (owner)

You can change directory permissions in Linux using the following commands. First, open the terminal and execute them. Remember to replace filename and directoryname with the actual names of your file or directory.

Chmod +rwx filename - This syntax adds new permissions

Chmod -rwx directoryname- It removes all the permissions in the specified directory

Chmod +wx-It allows executable permissions

Chmod -wx filename

How to change chmod permissions for group owners and others?

The command for changing permissions for group owners and others is similar to changing for solo owners. But you will have to add an "o" for owners and a "g" for groups after the name chmod. For example, chmod g+w filename for group or chmod o+w filename for others.

Contact us, if you did not find the right answer or you have a other question?

Copyright 2018-2022 Anto Online.

Important Legal stuff:
Acceptable Use Policy | Disclaimer | Privacy Policy | Terms and Conditions.

All rights reserved. Please consider the information, scripts and instructions carefully
before using it yourself. Make sure you have ample backups! The information, scripts and
instructions are provided without warranty. Consult a professional if you are unsure.
Anto does not speak on behalf of any company and our opinions are our own.