Permissionator

Linux chmod calculator for generating, converting and verifying file permissions

Permissions

Special Bits

setuid and setgid replace the execute bit with s/S on owner/group;
sticky replaces others' execute with t/T.

Custom Octal

Common Presets

What this means

Owner can read/write, others read-only — standard for text files, configs, and web content where only the owner edits.

Output

Octal (3-digit)
644
Octal (4-digit)
0644
Symbolic (rwx)
-rw-r--r--
Symbolic (equals)
u=rw,g=r,o=r

Example Commands

chmod (octal)
chmod 0644 file.txt
chmod (equals)
chmod u=rw,g=r,o=r file.txt

Output Options

How this was calculated

Owner
6
rw-
Group
4
r--
Public
4
r--
Owner
RWX
110
4 (read) + 2 (write) + 0 (execute) = 6
Group
RWX
100
4 (read) + 0 (write) + 0 (execute) = 4
Public
RWX
100
4 (read) + 0 (write) + 0 (execute) = 4

Single Permission chmod Generator

This tool allows you to generate a chmod command for a single permission change.
This means that all other permissions will remain unchanged. So you can easily modify/add/remove one permission for a given user type.

Class

Operator

Permission

What is chmod?

File permissions in Linux control who can read, write/edit and execute any given file. The chmod command is used to set these permissions.

These file permissions are a core feature of Linux and UNIX-like systems. They prevent unauthorized access or modifications of files, safeguard users from accidental changes, and ensure that only the right users can execute programs.

To set or update permissions, we use the `chmod` command. In the format of `chmod [permissions] [file/directory]`. The permissions can either be expressed in octal digits (like 755) or symbolic form (like u=rwx,g=rx,o=rx). The chmod combination is always specified in the order of (1) user, (2) group and (3) others/public.

Common Examples

  • chmod 600 ~/.ssh/id_rsaOwner read/write; private files like SSH keys
  • chmod 644 /var/www/html/index.htmlOwner read/write; everyone else read; typical text files
  • chmod 700 /home/user/private_script.shOwner full control; private scripts or directories
  • chmod 755 /usr/local/bin/my_script.shOwner and group users have full access, all other users can only read and run
  • chmod 775 /shared/projectEveryone can read and execute, but only the owner can write; good for shared directories

Viewing File Permissions

To view the current permissions of a file or directory, you can use the ls -l command.
This will display the permissions in a human-readable format, showing the user, group, and other permissions. For example:

ls -l [file-name]

Core Concepts

Octal basics

Each role gets a digit: read=4, write=2, execute=1. Sum to get the digit: e.g., rwx = 7, rw- = 6, r-x = 5, r-- = 4. Common modes: 644 for files, 755 for directories.

Symbolic form

Use letters for users (u), group (g), others (o) with +, -, or =. For example: chmod u=rw,g=r,o= file.txt sets read/write for owner, read for group, and no access for others.

Special bits

setuid runs executables with the owner's privileges; setgid runs with the group's privileges; sticky prevents users from deleting others' files in shared directories (e.g., /tmp).

Cheat Sheet

Example #1 - Symbolic Form

This command will give read, write and execute permissions to the owner, and read and execute (but not write) to users in the group, and all other users

chmod -rwxr-xr-x ./file.txt
Diagram explaining the structure of Linux file permission strings. Shows file type indicator followed by permissions for owner, group, and public. Example '-rwxr-xr-x' means owner can read, write, and execute, group can read and execute, others can read and execute.

Example #2 - Octal Denotion

This command will give read, write and execute permissions to the owner, and read and execute (but not write) to users in the group, and all other users

chmod 755 ./file.txt
Diagram showing chmod 755 in numeric and symbolic forms. Numeric form 755 corresponds to rwx for owner, r-x for group, and r-x for others, meaning owner can read, write, and execute, while group and others can only read and execute.Visual guide showing how Linux file permissions convert from symbolic form (rwx, r-x, r-x) to binary and then to numeric form (7, 5, 5) for user, group, and others.

Example #3 - Updating a single permission

This command will remove write permissions for the group, but leave read and execute permissions intact. The owner and others will not be affected.

chmod g-w ./file.txt
Diagram explaining chmod syntax with three sections: 'Who' showing u for user, g for group, o for others, a for all; 'Operators' showing + to add, - to remove, and = to set exact permissions; and 'Permissions' showing r for read, w for write, and x for execute.

Example #4 - Updating a single permission

Give the owner execute permission, while leaving read and write permissions intact. The group and others will not be affected. Below is the full list of options

chmod u+x ./file.txt
Table showing examples of chmod commands for modifying file permissions, including who the changes apply to, the operation performed, the permission type, and an explanation. Examples include u+r for adding read access to owner, g-w for removing write access from group, and a=x for setting execute-only permission for all.

Example #5 - Common Preset Quick Reference

This will make a file readable and writable by the owner, and just readable for the group and others. Remember, the first digit is user, second is group, third is others. So you can use the quick reference below to build your own permissions.

chmod 644 ./file.txt
Table mapping octal numeric values 0–7 to symbolic file permissions and their meanings. For example, 0 is no permissions (---), 4 is read only (r--), 5 is read and execute (r-x), and 7 is read, write, and execute (rwx).