Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I removed a user from my computer. Now there's a lot of files that I need to modify that are from the deleted user group.

How can I change ALL file group and owner from that deleted user without having to manually change the group for each file?

share|improve this question
add comment

1 Answer

Use find.

find / -gid 510 -exec chgrp staff {} +
share|improve this answer
1  
Right, except I would suggest + instead of \; for the exec to reduce the number of invocations. Also, note that this will take a while as it traverses your entire directory tree (which is unavoidable). –  Kevin Mar 31 '13 at 23:38
    
Yep, you're right. –  bahamat Mar 31 '13 at 23:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.