chmod Cheatsheet - Linux File Permission Reference
Scripts always ask for chmod +x, and wrong log-directory permissions break everything — understanding the permission quartet of owner/group/others plus the special bits makes most permission problems obvious at a glance. This table pairs numeric and symbolic forms, covering common combinations and when to use (and the risks of) SUID, SGID, and the sticky bit.
Permission Bits 6
r (read)Read permission, value 4
w (write)Write permission, value 2
x (execute)Execute permission, value 1
- (no permission)No permission, value 0
u g oUser (owner) / Group / Others
aAll, equivalent to ugo
Numeric Mode 6
chmod 755 filerwxr-xr-x (owner full, others read+execute)
chmod 644 filerw-r--r-- (owner read+write, others read-only)
chmod 700 filerwx------ (owner only)
chmod 600 filerw------- (owner read+write, common for private keys)
chmod 777 filerwxrwxrwx (everyone full — dangerous!)
chmod 750 dirrwxr-x--- (owner full, group read+execute)
Symbolic Mode 6
chmod u+x fileAdd execute for the owner
chmod go-w fileRemove write for group and others
chmod a+r fileAdd read for everyone
chmod u=rw,go=r fileSet owner read+write, others read-only
chmod +x script.shAdd execute for everyone (defaults to a when omitted)
chmod -R 755 dir/Recursively change directory permissions
Special Permissions 6
chmod u+s file (4755)SUID: runs with the owner's identity
chmod g+s dir (2755)SGID: new files in the dir inherit its group
chmod +t dir (1777)Sticky: only the owner can delete (e.g. /tmp)
chmod 4755 fileSet SUID in numeric mode
chmod 2755 dirSet SGID in numeric mode
chmod 1777 dirSet Sticky in numeric mode
Common Patterns 6
644Regular files (owner rw, others r)
755Executables and directories
600Private key files (SSH, SSL)
640Config files (owner rw, group r)
700Private directories (owner only)
750Shared directories (owner full, group r-x)
Related Commands 7
chmod --reference=file1 file2Copy file1's mode to file2
chown user fileChange the file owner
chown user:group fileChange both owner and group
chown -R user:group dir/Recursively change owner and group of a directory
chgrp group fileChange only the group
umask 022Set the default permission mask (new files 644, dirs 755)
umask -SShow the current default permission symbolically
Tips
- Numeric mode: r=4, w=2, x=1; sum them for the value (e.g. rwx = 4+2+1 = 7).
- A directory's x means you can enter it (cd); without x, even r won't let you in.
- SUID has no effect on scripts (only on binaries) and is a security risk — use with caution.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us