cv.cm
All tools

Chmod calculator

Works in this tab. Nothing is uploaded, and no file is changed.

Permissions
ReadWriteExecute
Owner
Group
Others
Special bits
Notation

Command
chmod 755 script.sh

For a folder (or -R) without special bits the command uses 00755: GNU chmod keeps a folder's setuid/setgid unless the number has that extra leading 0; macOS reads it as 0755.

The name is taken literally: spaces, quotes, $ ; & and also * ? [ ] are quoted, so a file such as Movie [1080p].mkv matches. Only a leading ~/ stays unquoted for your home folder. A name starting with - gets -- first.

How to use this tool

Turn Unix permissions between checkboxes, octal digits and the rwx string, and get the chmod command.

  1. Tick the permissions

    Each row is owner, group or others; each column is read, write or execute. Add setuid, setgid or sticky if you need them.

  2. Or type octal or rwx

    Type 644 or 4755, or paste rwxr-xr-x from ls -l. The other fields follow.

  3. Copy the command

    Enter a file or folder name, tick -R for a whole folder, then copy the chmod line and run it in your terminal.

FAQ

What does chmod 755 mean?

Each digit is one group: owner, group, others. Read is 4, write 2, execute 1. 7 = rwx for the owner, 5 = r-x for the group and for everyone else: rwxr-xr-x.

What are setuid, setgid and the sticky bit?

They are the optional fourth (leading) digit. Setuid (4) runs a program as its owner, setgid (2) runs it as its group or makes new files in a folder inherit the group, and sticky (1) on a folder such as /tmp lets only a file's owner delete it.

Why do I see a capital S or T?

ls shows s or t when the special bit and execute are both set, and S or T when the special bit is set without execute, which is usually a mistake.

Can I paste the string from ls -l?

Yes. Paste rwxr-xr-x or the full -rwxr-xr-x (the first letter is the file type and is ignored) and the boxes and octal update.

Does this change any files?

No. It only builds the command. Copy it and run it in your own terminal.