One Linux command per day: chgrp

Source: Internet
Author: User

1. Introduction to Commands

The chgrp (change group) is used to set the owning group of each specified file to the specified value. If you use--reference, the owning group for each file is set to be the same as the specified reference file.

2. Usage
     chgrp  [options] ... User group File ... Or:chgrp [options] ...--reference= reference file ...
3. Options

4. Example 1: Modify the owning group of LOG1 to DBA
0 1 0 April  :chgrp0  1 Root dba  0 April  : Log1
Example 2:-V options
chgrp -v  dba log1"log1" belongs to a group that has been reserved for DBA
Example 3:-r recursive modification
[Email protected] ~]#ls-LDdir1/drwxr-xr-x2Oracle DBA4096April -  -: -dir1/[[Email protected]~]#chgrp-Rv dba Dir1"Dir1/log1"The owning group has been reserved for DBA"dir1/log2"the owning group has changed to DBA"Dir1"The owning group has been reserved for DBA
Example 4: The owning group can be an ID
0 1 0 April  :chgrp00  1 0 April  : Log1
Example 5: Change the owning group of LOG2 to the same as Log1
0 1 0 April  :  log11 root dba  0 April   - :chgrp-  v--reference=log1 log2"  log2" belongs to a group that has been retained as root

One Linux command per day: chgrp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.