• 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 not found

by admin

chgrp: command not found

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}

If you encounter the below error while running the chgrp command:

chgrp: command not found

you may try installing the coreutils package as shown below as per your choice of distribution:

Distribution Command
OS X brew install coreutils
Debian apt-get install coreutils
Ubuntu apt-get install coreutils
Alpine apk add coreutils
Arch Linux pacman -S coreutils
Kali Linux apt-get install coreutils
CentOS yum install coreutils
Fedora dnf install coreutils
Raspbian apt-get install coreutils

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

6. Change the owner group of a symbolic link:

# chgrp -h group path/to/symlink

7. Change the owner group of a file/directory to match a reference file:

# chgrp --reference=path/to/reference_file path/to/file_or_directory

Conclusion

The chgrp command is also used to modify the group of a file or directory. This can only modify the group owner, unlike the previous command, chown,which could be used to modify user ownership and group ownership.

Filed Under: Linux

Some more articles you might also be interested in …

  1. pkcon: command not found
  2. How to add or delete a samba user under Linux
  3. How to load SELinux Module For Oracleasm
  4. How To Add/Remove Locale Archive in CentOS/RHEL 5,6
  5. dir Command Examples in Linux
  6. How to Create and Query a BTRFS File System
  7. How to enable IPv6 on CentOS / RHEL 6
  8. http_load Command Examples in Linux
  9. How to Create logical networks to segregate traffic in a data center in RedHat Virtualization (RHV)
  10. loadkeys Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright