Super User is a question and answer site for computer enthusiasts and power users. 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

What could be a command to find all files owned by "abc" user, I guess that can be extended to finding all files with group 'def'.


if I got result (ls -l) such as one shown below

-rwxrw-r--   1 apache web      1981 2009-01-22 08:10 unsubscribe.php

then I would like to find all files owned by apache or group web


share|improve this question

migrated from Feb 16 '12 at 3:20

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

The find command has options for both. See the find(1) man page for more details.

share|improve this answer
thnx. so can I print the result in say ls -l format? – Jaspreet Chahal Feb 16 '12 at 3:24
Absolutely. See the -printf or -ls predicates. – Ignacio Vazquez-Abrams Feb 16 '12 at 3:25
thanks! I will explore it more. – Jaspreet Chahal Feb 16 '12 at 3:28

find /home/ -user <username> -group <groupname>

and lots of other search criteria.

share|improve this answer
worked like charm. thnx – Jaspreet Chahal Feb 16 '12 at 3:28

Use the find program

find path -group group_name
share|improve this answer

You want find(1) there. It has a whole language on the command line to let you specify what to list based on, including uid, username, gid, and group by name.

share|improve this answer

The direct answer to your questions:

find /path -type f  \( -user apache -o group web \) -exec ls -l {}; \

The find manpage is very much less than enlightening. IMO.

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.