Effect of Permissions on Files

PermissionCharacterMeaning on File
Read-The file is not readable. You cannot view the file contents.
rThe file is readable.
Write-The file cannot be changed or modified.
wThe file can be changed or modified.
Execute-The file cannot be executed.
xThe file can be executed.
sIf found in the user triplet, it sets the setuid bit. If found in the group triplet, it sets the setgid bit. It also means that x flag is set.
When the setuid or setgid flags are set on an executable file, the file is executed with the file’s owner and/or group privileges.
SSame as s, but the x flag is not set. This flag is rarely used on files.
tIf found in the others triplet, it sets the sticky bit.
It also means that x flag is set. This flag is useless on files.
TSame as, t but the x flag is not set. This flag is useless on files.

Effect of Permissions on Directories (Folders)

Directories are special types of files that can contain other files and directories.

PermissionCharacterMeaning on Directory
Read-The directory’s contents cannot be shown.
rThe directory’s contents can be shown.
(e.g., You can list files inside the directory with ls .)
Write-The directory’s contents cannot be altered.
wThe directory’s contents can be altered.
(e.g., You can create new files , delete files ..etc.)
Execute-The directory cannot be changed to.
xThe directory can be navigated using cd .
sIf found in the user triplet, it sets the setuid bit. If found in the group triplet it sets the setgid bit. It also means that x flag is set. When the setgid flag is set on a directory, the new files created within it inherits the directory group ID (GID) instead of the primary group ID of the user who created the file.
setuid has no effect on directories.
SSame as s, but the x flag is not set. This flag is useless on directories.
tIf found in the others triplet, it sets the sticky bit.
It also means that x flag is set. When the sticky bit is set on a directory, only the file’s owner, the directory’s owner, or the administrative user can delete or rename the files within the directory.
TSame as t, but the x flag is not set. This flag is useless on directories.

Changing File permissions

The syntax of the chmod command when using the symbolic mode has the following format:

chmod [OPTIONS] [ugoa…][-+=]perms…[,…] FILE...

The first set of flags ([ugoa…]), users flags, defines the users’ classes for which the permissions to the file are changed.

  • u - The file owner.
  • g - The users who are members of the group.
  • o - All other users.
  • a - All users, identical to ugo.

When the users’ flag is omitted, it defaults to a.

The second set of flags ([-+=]), the operation flags, defines whether the permissions are to be removed, added, or set:

  • - - Removes the specified permissions.
  • + - Adds specified permissions.
  • = - Changes the current permissions to the specified permissions. If no permissions are given after the = symbol, all permissions from the specified user class are removed.


Each write, read, and execute permissions have the following number value:

  • r (read) = 4
  • w (write) = 2
  • x (execute) = 1
  • no permissions = 0

  • Owner: rwx=4+2+1=7
  • Group: r-x=4+0+1=5
  • Others: r-x=4+0+0=4

Using the method above, we come up to the number 754, which represents the desired permissions.


Here are some examples of how to use the chmod command in numeric mode:

  • Give the file’s owner read and write permissions and only read permissions to group members and all other users:

    chmod 644 dirname
  • Give the file’s owner read, write and execute permissions, read and execute permissions to group members and no permissions to all other users:

    chmod 750 dirname
  • Give read, write, and execute permissions, and a sticky bit to a given directory:

    chmod 1777 dirname
  • Recursively set read, write, and execute permissions to the file owner and no permissions for all other users on a given directory:

    chmod -R 700 dirname