Home Privacy Policy Feedback Link to us Site Map Forums

UNIX Basic commands: chmod


The chmod command changes the access mode of one file or multiple files.

The syntax for the chmod command is:

chmod [option] mode files

options:

-R Descend directory arguments recursively while setting modes.
-f Suppress error messages if command fails.

mode:

Who u=user, g=group, o=other, a=all (default)
Opcode + means add permission
- means remove permission
= means assign permission and remove the permission of unspecified fields
Permission r=Read, w=write, x=Execute, s=set uid bit, t=sticky bit
u=user, g=group, o=other, l=mandatory locking

Examples:

chmod 751 tech
chmod u=rwx, g=rx, o=x tech
chmod =r tech


* Please note that there are many flavors of UNIX, so if in doubt, consult your man pages.