LPIC-1 / デバイスとファイルシステム ・ コマンド問題
#
- chgrp staff report.txt✓ 正解
- chown staff report.txt
- chmod g=staff report.txt
- chgrp report.txt staff
💡 chgrp <グループ> <ファイル> で所有グループのみを変更します。chown では「chown :staff report.txt」のように先頭にコロンを付ければグループのみ変更できますが、「chown staff」は所有ユーザーを変えてしまいます。chmod は権限変更でグループ所有者は変えられません。
○ chgrp staff report.txt:正解。chgrp staff report.txt は所有グループのみを staff に変更します。
✕ chown staff report.txt:chown staff report.txt は所有ユーザーを staff に変更してしまい、グループ変更ではありません。
✕ chmod g=staff report.txt:chmod は権限(rwx)の変更用で、所有グループの変更はできません。
✕ chgrp report.txt staff:引数の順序が逆で、staff というファイルを操作しようとして失敗します。