man.lsPlain-English help for Unix commands

chmod Change file permissions

Sets who can read, write and run a file or folder. You reach for it to make a script executable, to lock a private file down, or to fix a "Permission denied" error. Permissions can be given as a number (such as 755) or as letters (such as u+x).

Synopsis

chmod [-fhv] [-R [-H | -L | -P]] mode file ...
chmod 755 file
chmod u+x file

Common options

Option or formWhat it does
-RApply the change to a folder and everything inside it. Use with care
-vVerbose: print each file as its mode is changed. Repeat it (-vv) to also see the old and new modes
-fStay quiet about files that cannot be changed, and do not report failure in the exit status
-hIf the target is a symbolic link, change the link itself instead of the file it points to
-H, -L, -PWith -R, choose how symbolic links are treated: -H follows links named on the command line, -L follows all links, -P follows none (the default)
u+xSymbolic mode. Who: u (owner), g (group), o (others), a (all). Action: + adds, - removes, = sets exactly. Permission: r read, w write, x run or enter
755Octal mode. Three digits for owner, group and others. Read is 4, write is 2, execute is 1, and you add them up. 7 is rwx, 5 is r-x, 6 is rw-, 4 is r--
XA symbolic permission: execute only if the item is a folder or already executable by someone. Useful with -R so plain files do not become executable

Examples

Make a script runnable by its owner, then run it
chmod u+x script.sh && ./script.sh
hello
Owner can read and write, everyone else can only read (644)
chmod 644 notes.txt && ls -l notes.txt
Keep a file private to its owner (600)
chmod 600 data.csv && ls -l data.csv
Remove write access from group and others
chmod go-w notes.txt && ls -l notes.txt
Make a script runnable by everyone, readable by all (755)
chmod 755 script.sh && ls -l script.sh
Fix a folder tree: folders searchable, files not executable
chmod -R u+rwX,go+rX docs && ls -lR docs

Notes

See also

Last reviewed 2026-10-07.