五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動(dòng)態(tài)

Linux chgrp命令詳細(xì)介紹和使用實(shí)例(改變文件或目錄的所屬用戶組)

發(fā)布日期:2022-03-16 08:19 | 文章來(lái)源:腳本之家

Chgrp命令就是changegroup的縮寫(xiě)!要被改變的組名必須要在/etc/group文件內(nèi)存在才行。

1.命令格式:

chgrp[選項(xiàng)][組][文件]

2.命令功能:

chgrp命令可采用群組名稱或群組識(shí)別碼的方式改變文件或目錄的所屬群組。使用權(quán)限是超級(jí)用戶。

3.命令參數(shù):

必要參數(shù):

-c當(dāng)發(fā)生改變時(shí)輸出調(diào)試信息

-f不顯示錯(cuò)誤信息

-R處理指定目錄以及其子目錄下的所有文件

-v運(yùn)行時(shí)顯示詳細(xì)的處理信息

--dereference作用于符號(hào)鏈接的指向,而不是符號(hào)鏈接本身

--no-dereference作用于符號(hào)鏈接本身

選擇參數(shù):

--reference=<文件或者目錄>

--help顯示幫助信息

--version顯示版本信息

4.使用實(shí)例:

實(shí)例1:改變文件的群組屬性

命令:


復(fù)制代碼
代碼如下:

chgrp -v bin log2012.log

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# ll
---xrw-r-- 1 root root 302108 11-13 06:03 log2012.log
[root@localhost test]# chgrp -v bin log2012.log
“log2012.log” 的所屬組已更改為 bin
[root@localhost test]# ll
---xrw-r-- 1 root bin 302108 11-13 06:03 log2012.log

說(shuō)明:

將log2012.log文件由root群組改為bin群組

實(shí)例2:根據(jù)指定文件改變文件的群組屬性

命令:


復(fù)制代碼
代碼如下:

chgrp --reference=log2012.log log2013.log

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# ll
---xrw-r-- 1 root bin 302108 11-13 06:03 log2012.log
-rw-r--r-- 1 root root 61 11-13 06:03 log2013.log
[root@localhost test]# chgrp --reference=log2012.log log2013.log
[root@localhost test]# ll
---xrw-r-- 1 root bin 302108 11-13 06:03 log2012.log
-rw-r--r-- 1 root bin 61 11-13 06:03 log2013.log

說(shuō)明:

改變文件log2013.log的群組屬性,使得文件log2013.log的群組屬性和參考文件log2012.log的群組屬性相同

實(shí)例3:改變指定目錄以及其子目錄下的所有文件的群組屬性

命令:

復(fù)制代碼
代碼如下:

chgrp -R bin test6

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# ll
drwxr-xr-x 2 root root 4096 11-30 08:39 test6
[root@localhost test]# cd test6
[root@localhost test6]# ll
---xr--r-- 1 root root 302108 11-30 08:39 linklog.log
---xr--r-- 1 root root 302108 11-30 08:39 log2012.log
-rw-r--r-- 1 root root 61 11-30 08:39 log2013.log
-rw-r--r-- 1 root root 0 11-30 08:39 log2014.log
-rw-r--r-- 1 root root 0 11-30 08:39 log2015.log
-rw-r--r-- 1 root root 0 11-30 08:39 log2016.log
-rw-r--r-- 1 root root 0 11-30 08:39 log2017.log
[root@localhost test6]# cd ..
[root@localhost test]# chgrp -R bin test6
[root@localhost test]# cd test6
[root@localhost test6]# ll
---xr--r-- 1 root bin 302108 11-30 08:39 linklog.log
---xr--r-- 1 root bin 302108 11-30 08:39 log2012.log
-rw-r--r-- 1 root bin 61 11-30 08:39 log2013.log
-rw-r--r-- 1 root bin 0 11-30 08:39 log2014.log
-rw-r--r-- 1 root bin 0 11-30 08:39 log2015.log
-rw-r--r-- 1 root bin 0 11-30 08:39 log2016.log
-rw-r--r-- 1 root bin 0 11-30 08:39 log2017.log
[root@localhost test6]# cd ..
[root@localhost test]# ll
drwxr-xr-x 2 root bin 4096 11-30 08:39 test6
[root@localhost test]#</p> <p>

說(shuō)明:

改變指定目錄以及其子目錄下的所有文件的群組屬性

實(shí)例4:通過(guò)群組識(shí)別碼改變文件群組屬性

命令:


復(fù)制代碼
代碼如下:

chgrp -R 100 test6

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# chgrp -R 100 test6
[root@localhost test]# ll
drwxr-xr-x 2 root users 4096 11-30 08:39 test6
[root@localhost test]# cd test6
[root@localhost test6]# ll
---xr--r-- 1 root users 302108 11-30 08:39 linklog.log
---xr--r-- 1 root users 302108 11-30 08:39 log2012.log
-rw-r--r-- 1 root users 61 11-30 08:39 log2013.log
-rw-r--r-- 1 root users 0 11-30 08:39 log2014.log
-rw-r--r-- 1 root users 0 11-30 08:39 log2015.log
-rw-r--r-- 1 root users 0 11-30 08:39 log2016.log
-rw-r--r-- 1 root users 0 11-30 08:39 log2017.log
[root@localhost test6]#

說(shuō)明:

通過(guò)群組識(shí)別碼改變文件群組屬性,100為users群組的識(shí)別碼,具體群組和群組識(shí)別碼可以去/etc/group文件中查看

香港快速服務(wù)器

版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開(kāi)通

自選配置、實(shí)時(shí)開(kāi)通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問(wèn)服務(wù)

1對(duì)1客戶咨詢顧問(wèn)

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部