Linux: Find User Files

by on July 3, 2009 · 1 comment· LAST UPDATED July 3, 2010

in

How do I find out all files owned by a user called tom or jerry under UNIX / Linux / BSD / OS X operating systems?

Use the find command as follows to find all files owned by a user called tom, in /home (open terminal and type the command):

find /home -user tom
find /home -user jerry

To find all files in the /sales directory owned by the vip group, enter:

 find /sales -group vip

You can restrict your search to *.c (all c files only) for user tom as follows:

find /home -user tom -type f -name "*.c"

You can restrict your search to directories only as follows:

find /home -user tom -type d

Where,

  • -type d - Find only directories.
  • -type f - Find only files.
  • -name "*.c" - Find all file ending with .c extension.


If you would like to be kept up to date with our posts, you can follow us on Twitter, Facebook, Google+, or even by subscribing to our RSS Feed.


{ 1 comment… read it below or add one }

1 Miguel August 24, 2012 at 7:04 pm

Excelent! just what i’ve been looking for :)

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: