2016-02-22 20:03:35 +00:00
|
|
|
# chgrp
|
|
|
|
|
|
|
|
> Change group ownership of files and folders.
|
|
|
|
|
2019-01-30 11:16:17 +00:00
|
|
|
- Change the owner group of a file/folder:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
|
|
|
`chgrp {{group}} {{path/to/file}}`
|
|
|
|
|
2019-01-30 11:16:17 +00:00
|
|
|
- Recursively change the owner group of a folder and its contents:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
|
|
|
`chgrp -R {{group}} {{path/to/folder}}`
|
|
|
|
|
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-01-30 11:16:17 +00:00
|
|
|
- Change the owner group of a file/folder to match a reference file:
|
2016-02-22 20:03:35 +00:00
|
|
|
|
2016-02-23 01:54:19 +00:00
|
|
|
`chgrp --reference={{path/to/reference_file}} {{path/to/file}}`
|