LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-13-2013, 07:04 AM   #1
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Rep: Reputation: Disabled
How to find files owned by a user


Hi Guys,

Is there any command to find all the files owned by a
particular user..
 
Old 10-13-2013, 07:14 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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
 
1 members found this post helpful.
Old 10-13-2013, 07:15 AM   #3
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 85
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.
 
1 members found this post helpful.
Old 10-14-2013, 09:21 AM   #4
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
how do i copy all those files to a directory?
 
Old 10-14-2013, 09:30 AM   #5
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,585

Rep: Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558
Quote:
Originally Posted by Jerico91 View Post
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
 
1 members found this post helpful.
  


Reply

Tags
files, find, user


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find all files owned by a user and copy them to a temp folder mikezoch Linux - Newbie 3 11-28-2011 06:02 PM
How to find root owned world writable files? pinga123 Linux - Newbie 23 10-14-2010 07:30 AM
Find the space for files owned by specific users sahil.jammu Linux - Newbie 15 03-04-2009 01:15 PM
is there a way to list all files owned by a user? KingPanda Debian 3 10-29-2008 08:16 PM
user access to files owned by root jonfa Linux - General 2 07-09-2007 11:58 AM


All times are GMT -5. The time now is 11:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration