名稱
? ? ? ? chgrp - 改變屬組
用法
? ? ? ??chgrp [OPTION]... GROUP FILE...
? ? ? ? chgrp [OPTION]... --reference=RFILE FILE...描述
改變屬組。使用--reference,改變FILE的屬組為RFILE。
-c, --changes
grep rn?????????????????類似-v,但是只在發生改變時展示信息。
-f, --silent, --quiet
? ? ? ? ? ? ? ? 折疊大部分錯誤消息。
-v, --verbose
? ? ? ? ? ? ? ? 為每個操作的文件輸出診斷信息。
linux df命令。--dereference
? ? ? ? ? ? ? ? 對每個軟鏈接的所指生效(這是默認值),而不是軟鏈接本身。
-h, --no-dereference
? ? ? ? ? ? ? ? 對軟鏈接生效,而不是指向的文件(只在能改變軟鏈接所屬的系統中有效)。
--no-preserve-root
實現shell、????????????????不特殊處理 '/' (默認)。
--preserve-root
? ? ? ? ? ? ? ? 無法對 '/' 進行遞歸操作。
--reference=RFILE
? ? ? ? ? ? ? ? 使用RFILE而不是GROUP。
linux useradd。-R, --recursive
? ? ? ? ? ? ? ? 遞歸操作文件和目錄。
當指定了 -R 選項時,以下選項修改層次結構的遍歷方式。如果指定多于一個選項,只有最后一個生效。
-H? ? ? ? 如果一個命令行參數是目錄的軟鏈接,就遍歷它。
-L? ? ? ? 遍歷每一個軟鏈接到遇到的目錄。
shell內置命令,-P? ? ? ? 不遍歷任何軟鏈接(默認)
--help? ?????????展示幫助文檔并退出
--version? ? ? ?輸出版本信息并退出?
使用示例:
[root@server dir]# ll
總用量 20
-rwxr-xr-x 2 root root 363 12月 2 16:36 a
lrwxrwxrwx 2 root root 4 12月 2 13:54 dir1 -> dir2
drwxr-xr-x 2 root root 4096 12月 2 14:08 dir2
drwxr-xr-x 3 root root 4096 12月 1 16:11 dir3
lrwxrwxrwx 2 root root 4 12月 2 13:54 dir4 -> dir2
-rwxr-xr-x 1 root root 4 12月 1 18:08 file2
-rwxr-xr-x 1 root test 0 11月 28 15:12 file3
-rwxr-xr-x 1 root root 0 11月 29 14:41 file4
-rwxr-xr-x 1 root root 164 11月 28 16:41 file.zip## 配置file2的屬組為test
[root@server dir]# chgrp test file2
[root@server dir]# ll
總用量 20
-rwxr-xr-x 2 root root 363 12月 2 16:36 a
lrwxrwxrwx 2 root root 4 12月 2 13:54 dir1 -> dir2
drwxr-xr-x 2 root root 4096 12月 2 14:08 dir2
drwxr-xr-x 3 root root 4096 12月 1 16:11 dir3
lrwxrwxrwx 2 root root 4 12月 2 13:54 dir4 -> dir2
-rwxr-xr-x 1 root test 4 12月 1 18:08 file2
-rwxr-xr-x 1 root test 0 11月 28 15:12 file3
-rwxr-xr-x 1 root root 0 11月 29 14:41 file4
-rwxr-xr-x 1 root root 164 11月 28 16:41 file.zip## 配置dir目錄的文件的屬組為test
[root@server dir]# chgrp -R test ~/dir
[root@server dir]# ll
總用量 20
-rwxr-xr-x 2 root test 363 12月 2 16:36 a
lrwxrwxrwx 2 root test 4 12月 2 13:54 dir1 -> dir2
drwxr-xr-x 2 root test 4096 12月 2 14:08 dir2
drwxr-xr-x 3 root test 4096 12月 1 16:11 dir3
lrwxrwxrwx 2 root test 4 12月 2 13:54 dir4 -> dir2
-rwxr-xr-x 1 root test 4 12月 1 18:08 file2
-rwxr-xr-x 1 root test 0 11月 28 15:12 file3
-rwxr-xr-x 1 root test 0 11月 29 14:41 file4
-rwxr-xr-x 1 root test 164 11月 28 16:41 file.zip
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态