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
本文深入探讨了在Linux系统中使用chgrp、chown、chmod命令进行文件和目录权限管理的方法,包括改变所有者、组别及权限设置的实例。
735

被折叠的 条评论
为什么被折叠?



