Cheatsheet: chmod & chown
Last updated 2026-06-21
Common modes
Set a normal readable file mode
Set an executable script or directory mode
Make a private key readable only by the owner
Make a directory private to the owner
View permissions in long listing format
Symbolic permissions
Add execute permission for the owner
Add execute permission for everyone
Remove write permission for group and others
Set owner permissions exactly to read and write
Copy owner permissions to group
Recursive changes and ownership
Change permissions recursively
Change file owner
Change owner and group
Change group only
Change ownership recursively
Special modes and defaults
Set the setuid bit on an executable
Set the setgid bit on a directory so new files inherit its group
Set the sticky bit on a shared directory
Use numeric mode with sticky bit for a shared directory
Show the current default permission mask
Set a common default mask for new files and directories
See also: