写这个主要是一下子忘记了好查找
-rw--w--w- 1 root root 0 Jun 7 19:35 testfile //文件的拥有者及拥有者级均为 root
[root@localhost home]# chown yangzongde testfile
[root@localhost home]# ls testfile -l
-rw–w–w- 1 yangzongde root 0 Jun 7 19:35 testfile //查看文件拥有者为 yangzongde,但组仍为 root
-rw–w–w- 1 yangzongde root 0 Jun 7 19:35 testfile //查看文件拥有者为 yangzongde,但组为 root
[root@localhost home]# chgrp yangzongde testfile //修改拥有者组为 yangzongde
[root@localhost home]# ls testfile -l
-rw–w–w- 1 yangzongde yangzongde 0 Jun 7 19:35 testfile
[root@localhost home]# chown root:root testfile // 使用 chown 一次性修改拥有者及组
[root@localhost home]# ls testfile -l
-rw–w–w- 1 root root 0 Jun 7 19:35 testfile
其实还有一种简单粗暴的方法 直接 cp file1 file2 你再去看文件拥有者和组用户 全部变成普通用户了