Wikipedia

chgrp

Also found in: Dictionary, Legal, Financial, Acronyms, Encyclopedia.
chgrp
Developer(s)AT&T Bell Laboratories
Initial releaseMay 1975
Operating systemUnix, Unix-like, Plan 9, Inferno, IBM i
PlatformCross-platform
TypeCommand

The chgrp (from change group) command may be used by unprivileged users on Unix-like systems to change the group associated with a file system object (such as a file, directory, or link) to one of which they are a member. A file system object has 3 sets of access permissions, one set for the owner, one set for the group and one set for others. Changing the group of an object could be used to change which users can write to a file.

History

The chgrp command was originally developed as part of the Unix operating system by AT&T Bell Laboratories.

It is also available in the Plan 9 and Inferno operating systems and in most Unix-like systems.

The chgrp command has also been ported to the IBM i operating system.[1]

Syntax

chgrp [options] group FSO 
  • The group parameter specifies the new group with which the files or directories should be associated. It may either be a symbolic name or an identifier.
  • The FSO specifies one or more file system objects, which may be the result of a glob expression like *.conf.

Frequently implemented options

-R recurse through subdirectories.

-v verbosely output names of objects changed. Most useful when "FSO" is a list.

-f force or forge ahead with other objects even if an error is encountered.

Example

$ 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 

The above command changes the group associated with file prog.conf from wheel to staff (provided the executing user is a member of that group). This could be used to allow members of staff to modify the configuration for programs prog and prox.

See also

References

  1. ^ IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). Retrieved 2020-09-05.

External links

This article is copied from an article on Wikipedia® - the free encyclopedia created and edited by its online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of Wikipedia® encyclopedia articles provide accurate and timely information, please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.

Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.