## Chgrp

Since Ant 1.6.

### Description

Changes the group of a file or all files inside specified directories. Right now it has effect only under Unix. The group atribute is equivalent to the coresponding argument for the chgrp command.

FileSets, DirSets or FileLists can be specified using nested `<fileset>`, `<dirset>` and `<filelist>` elements.

### Parameters

Attribute | Description | Required
file | the file or directory of which the group must be changed. | Yes or nested `<fileset/list>` elements.
group | the new group. | Yes
parallel | process all specified files using a single `chgrp` command. Defaults to true. | No
type | One of file, dir or both. If set to file, only the group of plain files are going to be changed. If set to dir, only the directories are considered. Note: The type attribute does not apply to nested dirsets - dirsets always implicitly assume type to be dir. | No, default is file
maxparallel | Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to <= 0 for unlimited. Defaults to unlimited. | No
verbose | Whether to print a summary after execution or not. Defaults to `false`. | No

### Examples

> `<chgrp file="${dist}/start.sh" group="coders"/>`

makes the "start.sh" file belong to the coders group on a UNIX system.

>     <chgrp group="coders">
>       <fileset dir="${dist}/bin" includes="**/*.sh"/>
>     </chgrp>

makes all ".sh" files below `${dist}/bin` belong to the coders group on a UNIX system.

>     <chgrp group="coders">
>       <fileset dir="shared/sources1">
>         <exclude name="**/trial/**"/>
>       </fileset>
>       <fileset refid="other.shared.sources"/>
>     </chgrp>

makes all files below `shared/sources1` (except those below any directory named trial) belong to the coders group on a UNIX system. In addition all files belonging to a FileSet with `id` `other.shared.sources` get the same group.

>     <chgrp group="webdev" type="file">
>       <fileset dir="/web">
>         <include name="**/*.test.jsp"/>
>         <include name="**/*.new"/>
>       </fileset>
>       <dirset dir="/web">
>         <include name="**/test_*"/>
>       </dirset>
>     </chmod>

makes all `.test.jsp`, and `.new` files belong to group webdev. Directories begining with `test_` also will belong to webdev, but if there is a directory that ends in `.new` or a file that begins with `test_` it will be unaffected.

Copyright © 2002-2004 The Apache Software Foundation. All rights Reserved.