• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All
  • About
Linux-Ubuntu | chgrp -- change group
  1. Notes
  2. Examples
  3. Command Help (man chgrp)

  1. Notes
    chgrp group file ...

    The chgrp command changes the group of files and directories.
  2. Examples
    • Change the group of "folder1" to "group1".
      $ chgrp group1 folder1/

    • Change the group of "folder1" (and its files and sub-directories) to "DOMAIN\group2".
      Use the escape character "\" to escape the character "\".
      You can also use the double quote character """ to delimit the folder path to escape the character "\".
      $ chgrp -R DOMAIN\\group2 folder1/
      
      $ chgrp -R "DOMAIN\group2" folder1/
  3. Command Help (man chgrp)
    The following options can be used:
    -R
    |If chgrp is applied to a directory, it will change the group of this directory and all its files and sub-directories.
    |By default, symbolic links will be changed.
    |But the linked files of symbolic links will not be changed.
    
    -L
    |If the -R option is specified, symbolic links will not be changed.
    |But the linked files of symbolic links will be changed.
    |The -L option overrides any previous -P options.
    |The -L option is ignored unless the -R option is specified.
    
    -P
    |If the -R option is specified, symbolic links will be changed.
    |But the linked files of symbolic links will not be changed.
    |The -P option overrides any previous -L options.
    |The -P option is ignored unless the -R option is specified.
    
    -v
    |Cause chgrp to be verbose, showing filenames if the group is modified.
© 2025  mtitek