本文共 1206 字,大约阅读时间需要 4 分钟。
chown
变更文件或者目录所属用户
chown 【参数】【用户:组】 【文件或者目录】
-R 递归
-V显示[root@localhost /]# chown AAA:AAA 1.txt [root@localhost /]# ls1.txt bbbbb boot etc lib media opt root sbin sys usrAAA bin dev home lib64 mnt proc run srv tmp var[root@localhost /]# ls -l总用量 40-rwxrw-rw-. 1 AAA AAA 7064 12月 18 16:49 1.txt
[root@localhost /]# chown -Rv AAA:AAA ABCchanged ownership of "ABC/A/B/C/D" from root:root to AAA:AAAchanged ownership of "ABC/A/B/C" from root:root to AAA:AAAchanged ownership of "ABC/A/B" from root:root to AAA:AAAchanged ownership of "ABC/A" from root:root to AAA:AAAchanged ownership of "ABC" from root:root to AAA:AAA[root@localhost /]#
[root@localhost /]# chown -R :root ABC[root@localhost /]# ls -l总用量 40-rwxrw-rw-. 1 AAA AAA 7064 12月 18 16:49 1.txtdrwxrwxrwx. 3 root root 16 12月 18 18:40 AAAdrwxr-xr-x. 3 AAA root 14 12月 18 19:10 ABC
[root@localhost /]# chown AAA: AAA[root@localhost /]# ls -l总用量 40-rwxrw-rw-. 1 AAA AAA 7064 12月 18 16:49 1.txtdrwxrwxrwx. 3 AAA AAA 16 12月 18 18:40 AAA
转载于:https://blog.51cto.com/sdwaqw/2052675