How to set
File & Directory
Permissions in Linux
using “chmod”
command
File & Directory Permissions
How to Change File/Directory Permissions in Linux for the user (u), group(g) and others (o)
• chmod u+rwx filename
• chmod u-r filename
• chmod g+w filename
• chmod g-wx filename
• chmod o+w filename
• chmod o-rwx filename
To Change Permissions in Numeric Code in Linux
• 0 = No Permission
• 1 = Execute
• 2 = Write
• 4 = Read
Basically, you add up the numbers depending on the level of permission you want
to give.
Permission numbers are:
0 = ---
1 = --x
2 = -w-
3 = -wx
4 = r-
5 = r-x
6 = rw-
7 = rwx
For example:
• chmod 777 [Link] will give read, write, and execute permissions for user, group &
others.
• chmod 700 [Link] will give read, write, and execute permissions for the user only.
• chmod 327 [Link] will give write and execute permission for the user, write for the
group, and read, write, and execute for others.