LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find files owned by a user (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-files-owned-by-a-user-4175480600/)

Jerico91 10-13-2013 07:04 AM

How to find files owned by a user
 
Hi Guys,

Is there any command to find all the files owned by a
particular user..

druuna 10-13-2013 07:14 AM

You can use the find command to do just that:
Code:

find / -user <username>
Also have a look at this: A complete tutorial on find

Robhogg 10-13-2013 07:15 AM

This will find files owned by user arnold on the system (you may need to run with root permissions to find all of them).

find / -user arnold 2>/dev/null

It's worth checking out find's man page - it's quite powerful.

Jerico91 10-14-2013 09:21 AM

how do i copy all those files to a directory?

TB0ne 10-14-2013 09:30 AM

Quote:

Originally Posted by Jerico91 (Post 5045439)
how do i copy all those files to a directory?

Chain the commands together, or use the backticks (simpler)
Code:

cp `find / -user <username>` /some/destination


All times are GMT -5. The time now is 11:31 PM.