linux 修改文件用户和组
来源:互联网 发布:计算机数据结构和算法 编辑:程序博客网 时间:2024/06/01 14:12
在创建时,任何文件的拥有者都是创建该文件的用户。当然用户可以修改该文件的拥有
者及拥有者组。在 shell 中,使用 chmod 和 chgrp函数来修改。示例如下:
[root@localhost home]# touch testfile //由 root 用户创建文件
[root@localhost home]# ls testfile –l
-rw--w--w- 1 root root 0 Jun 7 19:35 testfile //文件的拥有者及拥有者级均为 root
[root@localhost home]# chown yangzongde testfile //修改文件拥有者为 yangzongde
[root@localhost home]# ls testfile -l
-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
者及拥有者组。在 shell 中,使用 chmod 和 chgrp函数来修改。示例如下:
[root@localhost home]# touch testfile //由 root 用户创建文件
[root@localhost home]# ls testfile –l
-rw--w--w- 1 root root 0 Jun 7 19:35 testfile //文件的拥有者及拥有者级均为 root
[root@localhost home]# chown yangzongde testfile //修改文件拥有者为 yangzongde
[root@localhost home]# ls testfile -l
-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
阅读全文
0 0
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- Linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux修改文件所属用户和组
- linux 修改文件用户和组
- Linux修改文件用户和用户组
- Linux下用户、组的命令及修改文件实现用户和组的添加
- Ubuntu修改文件所属用户和组
- 修改文件所属组和用户
- 3.3.12 价格,成本和利润
- 3.3.15 十七种企业战略
- Linux网络
- 3.3.16 创新与企业家精神
- 3.3.17 利润和企业目标
- linux 修改文件用户和组
- 3.3.18 管理学总结
- 3.4 企业家——3.4.1 史蒂…
- JumpServer系统用户推送的时候卡死
- 3.4.2 稻盛和夫
- Android中如何实现手机拍照,并且展示ImageView控件上
- 3.4.3 比尔·盖茨
- 3.4.4 杰克·韦尔奇
- Bind variables