What Is chmod 755 and How to Use It

By
Marko Aleksic
Published:
July 24, 2025
Topics:

File permissions are a security mechanism for access management in Linux and other Unix-like operating systems. The chmod command allows administrators to define the level of access for the file's owner, group, and other system users.

This article focuses on the chmod 755 permission setting and its practical applications.

What is chmod 755 and how to use it.

What Is chmod 755?

chmod 755 sets access permission 755 for a file or directory. Each digit in the number corresponds to the sum of all permission types granted to a specific permission class. The first digit represents the owner, the second represents the group, and the third stands for other users.

The following is a list of numerical values for each permission type:

  • Read: 4
  • Write: 2
  • Execute: 1
  • No permission: 0

The table below breaks down permission 755 and the permission types that are part of it for each permission class:

Permission ClassPermission TypesDescription
Owner (7)Read (4)
Write (2)
Execute (1)
The owner has full read, write, and execute permissions.
Group (5)Read (4)
Execute (1)
Members of the file's group have read and execute permissions.
Others (5)Read (4)
Execute (1)
All other users have read and execute permissions.

chmod 755 vs. chown 755

chmod and chown are distinct commands addressing different aspects of file management. While chmod modifies file permissions, chown (change owner) modifies the ownership of a file or directory.

chown 755 is a syntactically incorrect command as chown expects a user and (optionally) a group, not a permission. For example, the following command changes the owner of the ~/test-file to pnap and the group to testgroup:

chown pnap:testgroup ~/test-file

How to Use chmod 755?

Using chmod 755 involves executing the command with the target file or directory as an argument. This section details the command execution and demonstrates integration with other commands.

Executing chmod 755 on File

To use chmod 755 on a file or directory, apply the following syntax:

chmod 755 [file_or_directory]

The following example applies 755 permissions to a file named script.sh:

chmod 755 script.sh

Applying chmod 755 to the file yields the following results:

  • The owner can read, write, and execute script.sh.
  • The group and others can read and execute script.sh.

Use the ls command to check the file after using chmod 755 and confirm the appropriate permissions have been granted:

ls -l
Checking file permissions with the ls command.

Executing chmod 755 on Directory

The effects of applying the 755 permissions on a directory are:

  • The owner can list directory contents, create, delete, and modify files within web_content, and navigate into it.
  • The group and others can list directory contents, navigate into web_content, and access files within it according to their individual permissions.

The following example uses the chmod command on a directory named web_content:

chmod 755 web_content

Undoing chmod 755

There is no specific command to undo the effects of chmod 755. Instead, apply another chmod command with the desired new set of permissions.

For example, to set a file back to read-only for all, use the command below:

chmod 444 [file_or_directory]

To remove all permissions for the group and others, but keep full access for the owner, enter the following:

chmod 700 [file_or_directory]

How to Use chmod 755 with Other Commands

Combine chmod 755 with other commands to automate permission changes across multiple files or directories. Refer to the sections below for examples of common usage.

Using with find

The find command can locate files or directories that meet specific criteria, and then execute chmod on them. This property is helpful for batch permission changes.

For example, enter the following command to change permissions to 755 for all shell scripts in the current directory and its subdirectories:

find . -name "*.sh" -exec chmod 755 {} \;

Another example shows how to find all directories under /var/www/html and set their permissions to 755:

find /var/www/html -type d -exec chmod 755 {} \;

Note: The command from the second example is typically executed to allow web servers to traverse directories.

Using with xargs

xargs can take output from one command and pass it as an argument to another, which is particularly helpful for handling large numbers of files.

The example below applies chmod 755 to all the files listed in a file named file_list.txt. The -v flag enables verbose output:

cat file_list.txt | xargs chmod -v 755

The output shows the system reading from the list and applying permission 755 to each file.

Applying permission 755 to multiple files listed in a file.

Using with rsync

The rsync command enables file transfers between local and remote systems. The following example shows how to use chmod with rsync and apply permission 755 to the server copy of the local directory /home/pnap/test:

rsync -av --chmod=755 /home/pnap/test/ [email protected]:/var/www/html/

How to Use chmod with Symbolic Permissions as Alternative

Symbolic permissions offer an alternative to numerical notation, providing a more human-readable method for modifying permissions. This method uses the following letters and symbols to represent users, groups, others, and permission types:

  • Users: u (owner), g (group), o (others), a (all).
  • Operations: + (add permission), - (remove permission), = (set permission exactly).
  • Permissions: r (read), w (write), x (execute).

Use the following symbolic permissions with chmod to achieve the same effect as chmod 755:

chmod u=rwx,g=rx,o=rx [file]

This command explicitly sets the read, write, and execute permissions for the owner, the read and execute permissions for the group, and the read and execute permissions for others.

Note: Symbolic mode can be more intuitive for specific permission adjustments, such as adding execute permission for everyone: chmod a+x [file].

Conclusion

After reading this tutorial, you should have a clear understanding of the chmod 755 permission setting. The article also showed how to leverage chmod 755 with commands like find and xargs, and how to apply the same permissions using symbolic syntax.

Next, learn more about user management in Linux.

Was this article helpful?
YesNo