Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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'm trying to find files which are owned and have the primary group of root. Is there a parameter available to search for files like this? It's critical that all files in a certain directory not be owned by root, so I'd like to check periodically to make sure that someone on the server isn't accidentally creating files owned by root (namely me). Sure, chown -R user:user /path works, but I'd like to be able to check.

share|improve this question
up vote 17 down vote accepted

man find:

  -group gname
         File belongs to group gname (numeric group ID allowed).
  -user uname
         File is owned by user uname (numeric user ID allowed).
share|improve this answer

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.