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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Use find.

find / -gid 510 -exec chgrp staff {} +
share|improve this answer
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

Your Answer


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.