chgrp
Quick Reference
Command Name:
chgrp
Category:
file ownership
Platform:
linux
Basic Usage:
Common Use Cases
- 1
Group ownership management
Change group ownership of files and directories
- 2
Permission management
Manage access permissions through group membership
- 3
System administration
Organize files by group ownership
- 4
Multi-user environments
Set up group access for shared resources
Syntax
chgrp [OPTION]... GROUP FILE... chgrp [OPTION]... --reference=RFILE FILE...
Options
Option | Description |
---|---|
-c, --changes | Like verbose but report only when a change is made |
-f, --silent, --quiet | Suppress most error messages |
-v, --verbose | Output a diagnostic for every file processed |
--dereference | Affect the referent of each symbolic link (default), rather than the symbolic link itself |
-h, --no-dereference | Affect symbolic links instead of any referenced file |
--no-preserve-root | Do not treat '/' specially (the default) |
--preserve-root | Fail to operate recursively on '/' |
--reference=RFILE | Use RFILE's group rather than specifying a GROUP value |
-R, --recursive | Operate on files and directories recursively |
--help | Display help and exit |
--version | Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the chgrp
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
chgrp staff filename.txt
chgrp developers file1.txt file2.txt file3.txt
chgrp 1001 config.conf
chgrp webadmin /var/www/html