Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

chgrp(1) [minix man page]

CHGRP(1)						      General Commands Manual							  CHGRP(1)

chgrp - change group SYNOPSIS
chgrp [-R] [owner:]group file ... OPTIONS
-R Change directory hierarchies EXAMPLES
chgrp system file1 file2 # Make system the group of the files chrgp -R other dir1 # Make other the group of all files below dir1 DESCRIPTION
The group field (and optionally owner field) of the named files is changed to group and owner . Alternatively, a decimal gid (uid) may be specified instead of a group name. If the -R flag is used, the changes will be applied recursively to all files in named directories. Only the superuser may execute this command to set arbitrary groups. Normal users can only change the group if they own the file, and the group is their own group (Minix), or one of their supplementary groups (Minix-vmd). SEE ALSO
chown(1), chmod(1), ls(1), chown(2). CHGRP(1)

Check Out this Related Man Page

CHGRP(3)								 1								  CHGRP(3)

chgrp - Changes file group

bool chgrp (string $filename, mixed $group) DESCRIPTION
Attempts to change the group of the file $filename to $group. Only the superuser may change the group of a file arbitrarily; other users may change the group of a file to any group of which that user is a member. PARAMETERS
o $filename - Path to the file. o $group - A group name or number. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Changing a file's group <?php $filename = 'shared_file.txt'; $format = "%s's Group ID @ %s: %d "; printf($format, $filename, date('r'), filegroup($filename)); chgrp($filename, 8); clearstatcache(); // do not cache filegroup() results printf($format, $filename, date('r'), filegroup($filename)); ?> NOTES
Note This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. Note When safe mode is enabled, PHP checks whether the files or directories being operated upon have the same UID (owner) as the script that is being executed. SEE ALSO
chown(3), chmod(3). PHP Documentation Group CHGRP(3)
Man Page

7 More Discussions You Might Find Interesting

1. Solaris

Owner of file gets 'not owner' error for chgrp

Hi Folks, I know that changing users and groups is pretty basic admin, but this one has got me stumped. When I try to change the group of a file for which I am the owner for, it still gives me a 'Not owner' error. For example, when I am logged in as 'webadmin', I have the following file: ... (4 Replies)
Discussion started by: brizrobbo
4 Replies

2. UNIX for Dummies Questions & Answers

Chgrp and Chown ???

Hi Can anybody please let me know the usage of Chgrp command with an example??? Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

3. OS X (Apple)

AFP mount + Chown/Chgrp respecting

Hello all... Does anyone know how to make an AFP mount of home directories (/Volumes/users off of another server) so that any users doing an ssh login retain write permission to their individual folders, read-write permissions to folders chowned to appropriate group... and so that newly created... (0 Replies)
Discussion started by: drkdev
0 Replies

4. Shell Programming and Scripting

Can't chgrp, chown on Linux

I have a problem on Linux wherein it doesn't allow me to use the chown and chgrp even if I am the owner of the file. Is this one of the Linux limitations? BTW, I can use chmod. (4 Replies)
Discussion started by: Jin_
4 Replies

5. Red Hat

Can't chgrp. Error - chgrp: changing group of `<file>': Invalid argument

I found that I cannot chgrp for some reason with error: chgrp: changing group of `<file>': Invalid argument This happens on all NFS mounted disks on client machines. We use AD (not my call) for authentication and it also provides groups. We have a NFS server running Scientific Linux 6.3... (1 Reply)
Discussion started by: venmx
1 Replies

6. Solaris

Chgrp failed on NAS mounted

Hi, I am facing chgrp issue for a directory on a NAS mounted partation. issue details : user1 belongs to two groups grp1(primary) and grp2(secondary) not able to change directory group to secondary. WORKING on /tmp #mkdir /tmp/a #ls -ld /tmp/a drwxr-xr-x 2 user1 grp1 117 Mar 24... (7 Replies)
Discussion started by: naveen.surisett
7 Replies

7. Shell Programming and Scripting

How to execute a command on each line of output from another command?

Hello :) new to bash not to programming. I have an on-going need to change the owning group on sets of files and directories from the one they were created with or changed to on update to the one they need to have going forward. find {target_root} -group wrong_group gets me a newline... (4 Replies)
Discussion started by: naftali
4 Replies