• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chgrp Command Examples in Linux

by admin

The chgrp command is used to change the group ownership of a file or directory. Changing the group ownership of an object ensures that the group permissions are applied to the specific group.

Syntax

The syntax of the chgrp command is:

# chgrp {group name} {file/ directory name}

chgrp Command Examples

1. To change the files group:

# chgrp SUPPORT file.txt

2. To see the status if the files group has been changed after firing the command:

# chgrp -c SUPPORt file.txt

3. To suppress any errors while changing:

# chgrp -f SUPPORT file.txt

4. To change the groups recursively:

# chgrp -R SUPPORt /dir/

5. To see the verbose output for every change is being made by command:

# chgrp -v SUPPORt file.txt

Filed Under: Linux

Some more articles you might also be interested in …

  1. umask: command not found
  2. aa-enforce: command not found
  3. How Files/Directories in /tmp gets Removed Automatically in CentOS/RHEL 5,6
  4. CentOS / RHEL : How to Set up SFTP to Chroot Jail only for Specific Group
  5. Sample /etc/mke2fs.conf file
  6. CentOS / RHEL 7 : How to disable all tty consoles and enable only 1
  7. service Command Examples in Linux
  8. Invalid ABI Option abi=aapcs-linux
  9. dd Command Examples in Linux
  10. Understanding MySQL Privileges

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright