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.

SysOps·37 commands·Last updated 2026-07-21
chmodPermissionslinux

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 o
User (owner) / Group / Others
a
All, equivalent to ugo

Numeric Mode 6

chmod 755 file
rwxr-xr-x (owner full, others read+execute)
chmod 644 file
rw-r--r-- (owner read+write, others read-only)
chmod 700 file
rwx------ (owner only)
chmod 600 file
rw------- (owner read+write, common for private keys)
chmod 777 file
rwxrwxrwx (everyone full — dangerous!)
chmod 750 dir
rwxr-x--- (owner full, group read+execute)

Symbolic Mode 6

chmod u+x file
Add execute for the owner
chmod go-w file
Remove write for group and others
chmod a+r file
Add read for everyone
chmod u=rw,go=r file
Set owner read+write, others read-only
chmod +x script.sh
Add 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 file
Set SUID in numeric mode
chmod 2755 dir
Set SGID in numeric mode
chmod 1777 dir
Set Sticky in numeric mode

Common Patterns 6

644
Regular files (owner rw, others r)
755
Executables and directories
600
Private key files (SSH, SSL)
640
Config files (owner rw, group r)
700
Private directories (owner only)
750
Shared directories (owner full, group r-x)

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