2016-02-22 15:03:35 -05:00
|
|
|
# chgrp
|
|
|
|
|
|
|
|
> Change group ownership of files and folders.
|
|
|
|
|
2019-02-08 01:31:19 +01:00
|
|
|
- Change the owner group of a file/directory:
|
2016-02-22 15:03:35 -05:00
|
|
|
|
2019-02-08 01:31:19 +01:00
|
|
|
`chgrp {{group}} {{path/to/file_or_directory}}`
|
2016-02-22 15:03:35 -05:00
|
|
|
|
2019-01-30 12:16:17 +01:00
|
|
|
- Recursively change the owner group of a folder and its contents:
|
2016-02-22 15:03:35 -05:00
|
|
|
|
|
|
|
`chgrp -R {{group}} {{path/to/folder}}`
|
|
|
|
|
2019-01-30 12:16:17 +01:00
|
|
|
- Change the owner group of a symbolic link:
|
2016-02-22 15:03:35 -05:00
|
|
|
|
2019-01-30 12:16:17 +01:00
|
|
|
`chgrp -h {{group}} {{path/to/symlink}}`
|
2016-02-22 15:03:35 -05:00
|
|
|
|
2019-02-08 01:31:19 +01:00
|
|
|
- Change the owner group of a file/directory to match a reference file:
|
2016-02-22 15:03:35 -05:00
|
|
|
|
2019-02-08 01:31:19 +01:00
|
|
|
`chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`
|