Avatar of Dung Do
Dung Do
Flag for United States of America asked on

Search then change owner ship for files/owner

I accident deleted one of the accounts on OpenLDAP and now the files/folder in my NFS and Isilon are all messed up. I need to search for folders/files with UID 3015 and change <user> account as owner. The problem is that there are too many files and folders that were changed because the account doesn't exist any more. Is there a script or command I can run to search for folder/files with <ID> then change <user> account as owner

For example:

drwxrwsrws.     3   3015   neuro     28 Dec 19      subject_5002

Need to change 3015 to <user> account
Linux

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
EXPERT CERTIFIED SOLUTION
noci

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
David Favor

Best to use noci's suggestion if you have many files, as noci's solution will work for any number of files... 1,000,000s of files, if this is required.
Your help has saved me hundreds of hours of internet surfing.
fblack61