Команда chgrp

For system V, changes the group that has access to a file or directory.

Синтаксис

chgrp newgroup filenames [-f] [-h]

newgroupSpecifies the new group that you wish to allow access to.
filenamesSpecifies the files that the newgroup has access to.
-fForce. Do not report errors.
-hIf the file is a symbolic link, change the group of the symbolic link. Without this option, the group of the file referenced by the symbolic link is changed.
-RRecursive. chgrp descends through the directory, and any subdirectories, setting the specified group ID as it proceeds. When a symbolic link is encountered, the group of the target file is changed (unless the -h option is specified), but no recursion takes place.

Примеры

chgrp hope file.txt - Would change the group to hope for the file file.txt if present and the group hope is valid.

Обратно к списку команд