文件拷贝后无法编辑,chmod查看权限,发现当前用户不在文件里的所有者或所有组你,需用chwon修改拥有者和分组。

chown mail:mail log2012.log

---xr--r-- 1 mail mail  302108 11-30 08:39 log2012.log

实例2:改变文件拥有者和群组

chown root: log2012.log

---xr--r-- 1 root root  302108 11-30 08:39 log2012.log

实例3:改变文件群组

chown :mail log2012.log

---xr--r-- 1 root mail  302108 11-30 08:39 log2012.log

实例4:改变指定目录以及其子目录下的所有文件的拥有者和群组

chown -R -v root:mail test6

[root@localhost test]# chown -R -v root:mail test6
“test6/log2014.log” 的所有者已更改为 root:mail
“test6/linklog.log” 的所有者已更改为 root:mail
“test6/log2015.log” 的所有者已更改为 root:mail
“test6/log2013.log” 的所有者已更改为 root:mail
“test6/log2012.log” 的所有者已保留为 root:mail
“test6/log2017.log” 的所有者已更改为 root:mail
“test6/log2016.log” 的所有者已更改为 root:mail

参考:
1、http://www.cnblogs.com/peida/archive/2012/12/04/2800684.html
2、http://cn.linux.vbird.org/linux_basic/0210filepermission.php

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-12-18
  • 2021-12-12
  • 2022-12-23
  • 2022-01-20
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-02-12
  • 2021-12-18
  • 2022-12-23
  • 2022-01-30
  • 2022-01-03
相关资源
相似解决方案