BLOG

CHMOD Sheet

28 Apr 2011, Posted by BoB in All Posts, Computer Talk, Network Talk, Website Talk

Permissions:
u – User who owns the file.
g – Group that owns the file.
o – Other.
a – All.
r – Read the file.
w – Write or edit the file.
x – Execute or run the file as a program.

Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody

Example:  chmod 641 file.html
owner = rw
group = r
other = x

Changing Owner:
To change the owner of a file or directory, the command chown is used.
Example 1:  chown username <file or directory>
Example 2:  To change the owner of ‘file1’ and ‘file2’ to the user ‘roger’
chown roger file1 file2

Changing Group:
To change the group of a file or directory, the command chgrp is used.
Example 1:  chgrp group <file or directory>
Example 2:  To change the group of ‘file1’ and ‘file2’ to the group ‘mgmt’
chgrp mgmt file1 file2

Post a comment