Changing Permissions for a File or Directory
Unix includes a command for setting file or directory permissions: chmod. Although this command can be a bit complicated, it is important. The security of your files and subdirectories depends on its proper usage.The chmod command uses the following syntax:
chmod mode file ...
The complex part of the chmod command is understanding what can go in the mode operand. This is where you specify the owner (also called user), group, and other (everyone else) permissions. You have two ways to do this: numerically and symbolically.
- You can learn more about the chmod command by viewing its man pages. In the Terminal window, type man chmod and press

Numeric permission modes
Numeric permission modes uses numbers to represent permissions options. The best way to explain this is to provide an example. Remember, the nine characters of the permissions coding in a directory listing can be broken down into three sets of three:
rwx | rwx | rwx |
user | group | other |
421 | 421 | 421 |
rwx | rwx | rwx |
user | group | other |
Symbolic permission modes
Symbolic permission modes enables you to add or remove privileges using symbols. For example, to remove write permission from the group and others, type chmod go-w file1. This translates to "take away write permissions from the group and others."The ownership symbols you use for this are:
u | user (owner) of the file or directory |
g | group owner of the file or directory |
o | others (everyone) |
a | all three (user, group, and others) |
r | read |
w | write |
x | execute |
+ | add the permission |
- | remove the permission |
= | set (add) the following permissions |
To change the permissions for a file or directory
In the Terminal window, type chmod mode file ... (for example, chmod 644 file1) and press


- Do not change the ownership and permissions of files on your computer with-out reason or if you're not sure what you're doing. The operating system assumes that certain files belong to certain users and have specific privileges. If you change the ownership or permissions on some system files, you may render your computer unusable! It's usually safe to modify your own filesthose that you createbut unless you know what you are doing, stay away from other files.
- If you include the -R option in the command (for example, chmod -R 644 folder1), the change is made recursively down through the directory tree. In other words, the change is made to the folder and every file and folder within it.