Template:Short description Template:Lowercase title {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other

<syntaxhighlight lang="text" class="" style="" inline="1">chgrp</syntaxhighlight>, short for change group, is a shell command for changing the group associated with a Unix-based file system file Template:Endash including special files such as directories. Changing the group of a file is restricted to a super-user (such as via <syntaxhighlight lang="text" class="" style="" inline="1">sudo</syntaxhighlight>) 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.

HistoryEdit

The <syntaxhighlight lang="text" class="" style="" inline="1">chgrp</syntaxhighlight> command was originally developed as part of the Unix operating system by AT&T Bell Laboratories. It is available in most Unix-like systems, Plan 9, Inferno and IBM i.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

The version of chgrp bundled in GNU coreutils was written by David MacKenzie.<ref>Template:Man</ref>

UseEdit

Generally, the syntax can be described as:

chgrp [options] group files
  • group specifies the group with which the files should be associated; may be either a symbolic name or an identifier
  • files specifies one or more files, which may be the result of a glob expression like <syntaxhighlight lang="text" class="" style="" inline="1">*.conf</syntaxhighlight>

Options:

  • <syntaxhighlight lang="text" class="" style="" inline="1">-R</syntaxhighlight> Recurse through directories
  • <syntaxhighlight lang="text" class="" style="" inline="1">-v</syntaxhighlight> Verbose output: log the name of each file changed
  • <syntaxhighlight lang="text" class="" style="" inline="1">-f</syntaxhighlight> Force or forge ahead even if an error occurs

ExamplesEdit

The following demonstrates changing the group of files matching <syntaxhighlight lang="text" class="" style="" inline="1">*.conf</syntaxhighlight> to staff Template:Endash provided the user owns the files (is gbeeker) and is a member of staff. The change will allow members of the group staff to modify the files since the group-class permissions (read/write) will apply; not the others-class permissions (read only).

<syntaxhighlight lang="console" highlight="4"> $ ls -l *.conf -rw-rw-r-- 1 gbeeker wheel 3545 Nov 04 2011 prog.conf -rw-rw-r-- 1 gbeeker wheel 3545 Nov 04 2011 prox.conf $ chgrp staff *.conf $ ls -l *.conf -rw-rw-r-- 1 gbeeker staff 3545 Nov 04 2011 prog.conf -rw-rw-r-- 1 gbeeker staff 3545 Nov 04 2011 prox.conf </syntaxhighlight>

See alsoEdit

ReferencesEdit

Template:Reflist

External linksEdit

Template:Sister project

Template:Unix commands Template:Plan 9 commands Template:Core Utilities commands

de:Unix-Kommandos#Benutzer- und Rechteverwaltung