What is the Difference Between “chmod +x” and “chmod 755”?

In Linux, the chmod command is the utility to set the privileges on the files and folders. The owner can set the permissions (read, write, and execute) using the special alphabets or through the octal values. 

The “chmod +x” command modifies the existing permissions with executable permission for all (owner, groups, and other users). while the “chmod 755” sets read, write, and executable permission to the owner and only the read, and execute permission to the groups, and other users.

This article will demonstrate the difference between “chmod +x” and “chmod 755”.

The “chmod +x” in Linux

When the file is created, the read and write permissions are assigned to all users. With the help of the “chmod +x” command, the user can modify the existing permissions with executable permissions. Let’s verify the discussion in the below example:

Example:

We have the “script.sh” file in our directory that only has the read and write permission:

Let’s execute the “chmod +x” command to give the executable permission:

$ chmod +x script.sh
$ ls -l script.sh

The file “script.sh” has the executable permissions now.

The “chmod 755” in Linux

The “chmod 755” sets the permission “read”, “write”, and “executable” permission to the owner while the group and other users will only have read and execute permissions.

Example:

We have a “script2.sh” file that will only have the read and write permissions:

Let’s execute the “chmod 755” command on it:

$ chmod 755 script2.sh
$ ls -l script2.sh

The file has the read, write, and executable to the owner while the group and other users have read and executable permission.

To know more about the “chmod 755” command, check out our latest guide on it.

Difference Between “chmod +x” and “chmod 755”

The difference between “chmod +x” and “chmod 755” is given in the below-mentioned table:

“chmod +x”“chmod 755”
The “chmod +x” command enables the user to modify already existing permission with executable permissions for all users.The “chmod 755” command sets the permissions for all users based on the octal values. 
Only modify the executable permission.The octal value “7” sets the read, write, and executable permission for the owner. while both “5” sets the read and execute permissions only to the groups as well as other users.

Conclusion

From the above discussion, it is concluded that the “chmod +x” command only refers to the execute permission for all the users simultaneously while the “chmod 755” command has different permissions for every user. This write-up has illustrated the difference between “chmod +x” and “chmod 755”.