chmod - this is the command hat we use to change the permission.
chmod 777 test
{change the permission to 777 the file test in the current directory}
chmod 777 /home/melick/test
{change the permission to 777 the file test in the /home/melick directory}
chmod g-r test {remove read permission in the group}
chmod g+r test {add read permission in the group}
chmod o-r test {remove read permission in the other}
chmod o+r test {add read permission in the other}
chmod u-r test {remove read permission in the user/owner}
chmod u+r test {add read permission in the user/owner}
chmod u=r test {read permission only to the user/owner}
chmod u=w test {write permission only to the user/owner}
chown - this command is use to change the owner of the file.
chown root test
{ if we want to change ownership to the file to the root }
-rw-r--r-- 1 root melick 0 2008-12-21 21:11 test
chown Melick:Sachika test
{change 'test' files owner as Melick and group as Sachika}
chgrp - this command is use to change the group of the file.
chgrp root test {change the group to 'root' in the file 'test' }
Comments