• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Linux-Ubuntu | chmod -- change file modes
  1. Notes
  2. Examples
  3. Command Help (man chmod)

  1. Notes

    The chmod command can be used to modify the file mode of files and directories.

    The chmod command can also be used to modify the Access Control Lists (ACLs) associated with files and directories: chmod -- change file ACLs (Access Control Lists).

    Files (and directories) have the ownership set for a user, group, or others. Each of them can define three regular types of permissions: read (r), write (w), and execute (x). The dash (-) character is used when a permission is not set. A file (or directory) permissions are set using 9 bits (rwxrwxrwx) that define the read, write, and execute permissions for the user, group, and others. The first 3 bits defines the read, write, and execute permissions for the user, the next three bits for the group, and the last three bits for others.

    By default permissions of a new created file (or directory) is set using the value of umask (default 002). To set the permission of the new created file (or directory), the value of umask 002 is combined with the default permissions of a file which is 666 (or directory 777). So by default a new created file has the permissions rw-rw-r-- (664) and new created directory has the permissions rwxrwxr-x (775).
  2. Examples
    • Set the permission "read", "write", and "execute" to "user", "group", and "others" on the file "file1".

      Use any of the following commands:

    • Set the permission "read", "write", and "execute" to "user" and set the permission "read" and "execute" to "group" and "others" on the file "file1".

      Use any of the following commands:

    • Add the permission "read" and "write" to "user" and "group" on the file "file1".
      If user or group have already the execute permission, they will keep this permission.


    • Deny the permission "read" and "write" to "user" and "group" on the file "file1".
      If user or group have already the execute permission, they will keep this permission.


    • Deny all permission to "group" and "others" on the file "file1".

      Use any of the following commands:

    • Set the permission "read", "write", and "search/execute" to "user", "group", and "others" on the directory "folder1" and all its files and sub-directories.

      Use any of the following commands:
  3. Command Help (man chmod)
    • The following options can be used:




    • The symbolic mode can be described by one of the following grammar.

      Short syntax:

      Detailed syntax:

    • The who symbols specify:

    • The permission symbols specify:

    • The permission symbols can be represented by numeric values as follow:



    • The operation symbols specify:


© 2025  mtitek