chgrp : change the group
chown: change the owner
chmod: change the permission
chgrp [-R] dirname/filename......
For example:
chgrp users install.log
chown [-R] username dirname/filename
For example:
chown root:root install.log
chmod [-R] xyz dirname/filename
r:4
w:2
x:1
For example:
chmod 777 ./bashrc
if you wanna change the permission of .bashrc to -rw-r--r--
chmod 644 .bashrc
u
g + r
chmod - w dirname / filename
o = x
a
For example:
let's change the permission of a file to -rwxr-xr-x
chmod u=rwx,go=rx .bashrc (note: there is not space in statement:u=rwx,go=rx)
For example:
If there is a filename , I don't know it's permission, and we just like it have write permission. we can use the next statement.
chmod a+w .bashrc
Let's canceling the execute permission:
chmod a-x .bashrc
chown: change the owner
chmod: change the permission
chgrp [-R] dirname/filename......
For example:
chgrp users install.log
chown [-R] username dirname/filename
For example:
chown root:root install.log
chmod [-R] xyz dirname/filename
r:4
w:2
x:1
For example:
chmod 777 ./bashrc
if you wanna change the permission of .bashrc to -rw-r--r--
chmod 644 .bashrc
u
g + r
chmod - w dirname / filename
o = x
a
For example:
let's change the permission of a file to -rwxr-xr-x
chmod u=rwx,go=rx .bashrc (note: there is not space in statement:u=rwx,go=rx)
For example:
If there is a filename , I don't know it's permission, and we just like it have write permission. we can use the next statement.
chmod a+w .bashrc
Let's canceling the execute permission:
chmod a-x .bashrc