修改文件的所有者与所属组

小结


修改文件file1的所有者为zs,所属组为it
?
chown zs.it file1


修改文件file1的所属组为hr
?
chown .hr file1


修改文件file1的所有者为xc
?
chown xc file1

只修改所属者

在这里插入图片描述

chown 用户名 文件名

chown root aa.txt

只修改文件所属组

在这里插入图片描述

同时修改所有者与所属组

在这里插入图片描述

把文件的所有者改为python,所属组改为root

chown python.root aa.txt

[python@localhost testdir]$ sudo chown python.root aa.txt

小结

在这里插入图片描述

Logo

更多推荐