2016-02-22 20:03:35 +00:00
|
|
|
# chgrp
|
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
> Change group ownership of files and directories.
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/chgrp>.
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
- Change the owner group of a file/directory:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`chgrp {{group}} {{path/to/file_or_directory}}`
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Recursively change the owner group of a directory and its contents:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
`chgrp -R {{group}} {{path/to/directory}}`
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-01-30 11:16:17 +00:00
|
|
|
- Change the owner group of a symbolic link:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-01-30 11:16:17 +00:00
|
|
|
`chgrp -h {{group}} {{path/to/symlink}}`
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
- Change the owner group of a file/directory to match a reference file:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`
|