系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux使用chgrp命令的方法

Linux使用chgrp命令修改文件所屬群組的方法(2)

時間:2014-12-30 16:29:42 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時看資訊 2. 請使用手機瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20141230/33754.html 手機查看 評論

  4.使用實例:

  實例1:改變文件的群組屬性

  命令:

  代碼如下:

  chgrp -v bin log2012.log

  輸出:

  代碼如下:

 。踨oot@localhost test]# ll

  ---xrw-r-- 1 root root 302108 11-13 06:03 log2012.log

 。踨oot@localhost test]# chgrp -v bin log2012.log

  “log2012.log” 的所屬組已更改為 bin

 。踨oot@localhost test]# ll

  ---xrw-r-- 1 root bin 302108 11-13 06:03 log2012.log

  說明:

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

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

  命令:

  代碼如下:

  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 root 61 11-13 06:03 log2013.log

 。踨oot@localhost test]# chgrp --reference=log2012.log log2013.log

 。踨oot@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

  說明:

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

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

  命令:

標(biāo)簽 命令 chgrp

發(fā)表評論

0

沒有更多評論了

評論就這些咯,讓大家也知道你的獨特見解

立即評論

以上留言僅代表用戶個人觀點,不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

官方交流群 軟件收錄