tldr/pages/common/chgrp.md

20 lines
510 B
Markdown
Raw Normal View History

2016-02-22 20:03:35 +00:00
# chgrp
> Change group ownership of files and directories.
2016-02-22 20:03:35 +00:00
- Change the owner group of a file/directory:
2016-02-22 20:03:35 +00:00
`chgrp {{group}} {{path/to/file_or_directory}}`
2016-02-22 20:03:35 +00:00
- Recursively change the owner group of a directory and its contents:
2016-02-22 20:03:35 +00:00
`chgrp -R {{group}} {{path/to/directory}}`
2016-02-22 20:03:35 +00:00
- Change the owner group of a symbolic link:
2016-02-22 20:03:35 +00:00
`chgrp -h {{group}} {{path/to/symlink}}`
2016-02-22 20:03:35 +00:00
- Change the owner group of a file/directory to match a reference file:
2016-02-22 20:03:35 +00:00
`chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`