DevTools Hub

Search tools

Search for a developer tool

Linux Security

chmod Command Generator

Build a real chmod command from symbolic clauses (u+rwx, g-w, o=r) and flags like -R and -v.

Part of the Linux Security Toolkit

Adds read for the owner.

chmod u+r file.sh

What this does

Builds a real chmod command from symbolic clauses — u+rwx, g-w, o=r — the way you'd actually type a permission change rather than specify a final state from scratch. Add as many clauses as the command needs, each targeting its own scope, operator, and permission letters, plus the real flags (-R, -c, -v) that show up in scripts and deploy steps.

How this differs from the permissions calculator

Linux Permissions Calculator answers "what should the final permissions be" — pick the end state in octal, symbolic, or checkboxes, and it hands back the one chmod command that sets exactly that. This tool answers a different question: "what change do I want to make" — relative, additive edits like add execute for the group or remove write from everyone but the owner, without needing to know or restate the file's current permissions first. Both produce a working chmod command; which one fits depends on whether you're thinking in absolute state or in a delta.

The three operators

Why capital X exists

Lowercase x adds or removes execute unconditionally. Capital X only touches execute on directories, or on files that already have execute set for at least one scope — exactly the safe idiom chmod vs chown covers for recursing over a mixed tree of files and directories without either breaking traversal or making every plain file executable. This tool warns you when a recursive command would strip execute with lowercase x or a bare =, since that's the single most common way a recursive chmod locks people out of their own directories.

setuid, setgid, and the sticky bit

s sets setuid (on u) or setgid (on g); t sets the sticky bit, conventionally applied without a scope or on o since it only affects the others-execute display position. See Linux Permissions Calculator for what each of these actually does at the filesystem level.

Common mistakes

FAQ

Can I target multiple scopes with different permissions in one command?

Yes — add one clause per scope (or combination of scopes) and they're joined with commas into a single symbolic mode string, exactly like typing u+rwx,g+rx,o-rwx by hand.

What does -c do that -v doesn't?

-v reports every file chmod touches, whether or not anything actually changed; -c reports only the files whose permissions genuinely changed — quieter output when running recursively over a large tree.

Does this tool run the command for me?

No — it only builds the command string. Copy it into your own terminal; nothing here touches a real filesystem.

Try it yourself

Need the exact octal or symbolic permissions for a known end state instead of a relative change? Linux Permissions Calculator converts between octal, symbolic, and checkboxes directly.

Related tools