Skip to content
EntityQ306061· pop 26· linked from 218 articles

', short for change group', is a shell command for changing the group associated with a Unix-based file system file including special files such as directories. Changing the group of a file is restricted to a super-user (such as via ) or to the file's owning user if the user is in the specified group.

Key facts

Software.name
chgrp
Software.screenshot
Chgrp-example-command.gif
Software.caption
Example usage of command to change the files' groups
Software.developer
AT&T Bell Laboratories
Software.programming language
Plan 9: C
Software.operating system
Unix, Unix-like, Plan 9, Inferno, IBM i
Software.platform
Cross-platform
Software.genre
Command
Software.license
Plan 9: MIT License

via Wikipedia infobox

Described at

The chgrp utility shall set the group ID of the file named by each file operand to the group ID specified by the group operand. For each file operand, or, if the -R option is used, each file encountered while walking the directory trees specified by the file operands, the chgrp utility shall perform actions equivalent to the chown () function defined in the System Interfaces volume of POSIX.1-2017, called with the following arguments: Unless chgrp is invoked by a process with appropriate privileges, the set-user-ID and set-group-ID bits of a regular file shall be cleared upon successful completion; the set-user-ID and set-group-ID bits of other file types may be cleared. For each file operand that names a file of type symbolic link, chgrp shall attempt to set the group ID of the symbolic link instead of the file referenced by the symbolic link. If the -R option is specified and a symbolic link is specified on the command line or encountered during the traversal of a file hierarchy, chgrp shall change the group ID of the symbolic link. The chgrp utility shall not follow the symbolic link to any other part of the file hierarchy. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( Some implementations restrict the use of chgrp to a user with appropriate privileges when the group specified is not the effective group ID or one of the supplementary group IDs of the calling process. The System V and BSD versions use different exit status codes. Some implementations used the exit status as a count of the number of errors that occurred; this practice is unworkable since it can overflow the range of valid exit status values. The standard developers chose to mask these by specifying only 0 and 0 as exit values. IEEE PASC Interpretation 1003.2 172 is applied, changing the CONSEQUENCES OF ERRORS section to "Default.". SD5-XCU-ERN-8 is applied, removing the -R from the first line of the SYNOPSIS.

Excerpt from a page describing this subject · 9,186 chars · not written by Vinony

Wikidata facts

Show 2 more facts
Sources (2)

via Wikidata · CC0

~2 min read

Article

6 sections
Contents
  • History
  • Use
  • Examples
  • See also
  • References
  • External links

', short for change group', is a shell command for changing the group associated with a Unix-based file system file including special files such as directories. Changing the group of a file is restricted to a super-user (such as via ) or to the file's owning user if the user is in the specified group.

A file has access permissions for the owning user, a group and for others. Changing the group for a file changes access to it based on users' group memberships.

Connections

Categories