1846033 Members
3519 Online
110253 Solutions
New Discussion

script help

 
SOLVED
Go to solution
I.Delic
Super Advisor

script help

Hi,

Can you help me with this:

I want to change grup ownerschip for alle files owned by progress_dba. New grup is prog_dba.

Thank you in advance

Idriz
8 REPLIES 8
Pete Randall
Outstanding Contributor
Solution

Re: script help

find /dirname -group progress_dba -type f -exec chown prog_dba {} \;


Pete

Pete
Sundar_7
Honored Contributor

Re: script help

find /filesystem -group progress_dba -exec chgrp prog_dba {} \;
Learn What to do ,How to do and more importantly When to do ?
I.Delic
Super Advisor

Re: script help

thank you pete

I forget to say i should change the ownership of the directorys too


Idriz
Jean-Luc Oudart
Honored Contributor

Re: script help

Use the find command

find -user progress_dba -exec chgrp prog_dba {} \;

Regards,
Jean-Luc
fiat lux
Sundar_7
Honored Contributor

Re: script help

chown will not change the group ownership of the file except when accompanied by user:group format ?
Learn What to do ,How to do and more importantly When to do ?
Pete Randall
Outstanding Contributor

Re: script help

First, I should have said chgrp rather than chown. Second, if you want to change the directories too, then just leave out the "-type f".


Pete

Pete
Prashant Zanwar_4
Respected Contributor

Re: script help

I believe best option shall be

chown -R owner:group (owner will be same as previous in this case)

chgrp -R group /dir

I believe this shall satisfy your need.

Thanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
I.Delic
Super Advisor

Re: script help

thank you all