chgrp files from one specific group to another

R

rgirardin

Guest
Hi All,

I was wonder if there was a way (without scripting) to change a set of files from one group to another only if the files belong to a certain group. My use case is I have a deep folder structure with some files owned by group A and some by group B. I want to do a chgrp on the top level folder but only have files owed by group a change to group C.

i.e. chgrp -R groupA=>groupC folder

I checked the man pages (didn't understand the bit about --reference if that is the way) and google with know luck. If I need to script I can, was just wondering if there's already some exitsting way.

TIA
 


G

glenn4uk

Guest
rgirardin,

Sorry I don't quite undertand exactly what you're trying to do but I think what you want to look at is the find command with the -group option:

find . -group A -exec chgrp C {} \;

This might be what you're looking for. It locates all files in the current directory owned by group A and changes them to group C.
 
R

rgirardin

Guest
rgirardin,

Sorry I don't quite undertand exactly what you're trying to do but I think what you want to look at is the find command with the -group option:

find . -group A -exec chgrp C {} \;

This might be what you're looking for. It locates all files in the current directory owned by group A and changes them to group C.
That was exactly what I needed.
Thanks a lot!
 


Members online


Top