Chmod Calc
by @ohernandez-dev-blossom
Calculate chmod permissions — convert between numeric (octal) and symbolic notation, and generate the chmod command. Use when the user asks what chmod 755 me...
clawhub install chmod-calc📖 About This Skill
name: chmod-calc description: Calculate chmod permissions — convert between numeric (octal) and symbolic notation, and generate the chmod command. Use when the user asks what chmod 755 means, how to set file permissions, or what symbolic notation rwxr-xr-x translates to.
chmod Calculator
Convert file permission specifications between numeric (octal) and symbolic notation, and produce the corresponding chmod command.
Input
755, 644, 4755)rwxr-xr-x)Output
rwxr-xr-x)chmod 755 filenamechmod u+rwx,g+rx,o+rx filenameInstructions
Permission bit values
Each entity (owner/group/others) is a sum of:Special permission bits (4th leading digit)
Numeric → Symbolic conversion
Given a 3-digit octetOGO:
r if bit 2 set, w if bit 1 set, x if bit 0 set, else -.S: setuid sets s/S in owner execute position; setgid sets s/S in group execute position; sticky sets t/T in others execute position.Symbolic → Numeric conversion
Map each 3-char group to a digit using the bit values above.Symbolic chmod command format
Build clauses for each entity with permissions set:u = owner, g = group, o = others{entity}+{perms} for each entity that has any permissionsu+s (setuid), g+s (setgid), +t (sticky)Common permission reference
| Numeric | Symbolic | Description | |---------|-------------|--------------------------------| | 644 | rw-r--r-- | Standard file (owner rw, rest r) | | 755 | rwxr-xr-x | Standard directory/executable | | 600 | rw------- | Private file (owner only) | | 700 | rwx------ | Private directory/executable | | 777 | rwxrwxrwx | Full access (avoid in production) | | 4755 | rwsr-xr-x | Setuid executable | | 2755 | rwxr-sr-x | Setgid executable | | 1755 | rwxr-xr-t | Sticky directory |Options
Examples
Input: 755
Output:
Numeric: 755
Symbolic: rwxr-xr-x
Command (numeric): chmod 755 filename
Command (symbolic): chmod u+rwx,g+rx,o+rx filenameOwner: read, write, execute
Group: read, execute
Others: read, execute
Input: 644
Output:
Numeric: 644
Symbolic: rw-r--r--
Command (numeric): chmod 644 filename
Command (symbolic): chmod u+rw,g+r,o+r filenameOwner: read, write
Group: read
Others: read
Input: rwxr-xr-x
Output:
Numeric: 755
Symbolic: rwxr-xr-x
Command (numeric): chmod 755 filename
Command (symbolic): chmod u+rwx,g+rx,o+rx filename
Input: "owner can read and write, group can read, others nothing" Output:
Numeric: 640
Symbolic: rw-r-----
Command (numeric): chmod 640 filename
Command (symbolic): chmod u+rw,g+r filename
Error Handling
777 that this allows full access to everyone and is a security risk.💡 Examples
Input: 755
Output:
Numeric: 755
Symbolic: rwxr-xr-x
Command (numeric): chmod 755 filename
Command (symbolic): chmod u+rwx,g+rx,o+rx filenameOwner: read, write, execute
Group: read, execute
Others: read, execute
Input: 644
Output:
Numeric: 644
Symbolic: rw-r--r--
Command (numeric): chmod 644 filename
Command (symbolic): chmod u+rw,g+r,o+r filenameOwner: read, write
Group: read
Others: read
Input: rwxr-xr-x
Output:
Numeric: 755
Symbolic: rwxr-xr-x
Command (numeric): chmod 755 filename
Command (symbolic): chmod u+rwx,g+rx,o+rx filename
Input: "owner can read and write, group can read, others nothing" Output:
Numeric: 640
Symbolic: rw-r-----
Command (numeric): chmod 640 filename
Command (symbolic): chmod u+rw,g+r filename