Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

chgrp 變更檔案群組:語法、遞迴、參考檔、符號連結處理、超級用戶權限、與 chown 差異

編輯:關於 Linux

chgrp (change group) 僅變更群組,群組名需存在於 /etc/group,需 root 權限。

語法與參數

chgrp [選項] 群組 檔案...
  • -R:遞迴。
  • -v:詳細輸出、-c:僅變更輸出。
  • --reference=檔案:複製參考檔群組。
  • --dereference:作用於連結目標(預設)。
  • --no-dereference:作用於連結本身。

範例

  • chgrp staff report.txt
  • chgrp -R developers /home/dev
  • chgrp --reference=file1 file2

chown :group file 效果相同,但 chgrp 語意更明確,腳本可讀性更高。

上一頁123下一頁共3頁

Copyright © Windows教程網 All Rights Reserved