tldr/pages/common/chgrp.md

21 lines
578 B
Markdown
Raw Normal View History

2016-02-22 20:03:35 +00:00
# chgrp
> Change group ownership of files and directories.
> More information: <https://www.gnu.org/software/coreutils/chgrp>.
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}}`