LinuxQuestions.org
Review your favorite Linux distribution.
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 07-04-2012, 03:01 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
all user file


I would like to know all the files which are created by a specific user ( eg. edp_user ) as I would like to remove these files in the system , except use "find" command , what can I do ?

thx
 
Old 07-04-2012, 03:21 AM   #2
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
Why don't you use userdel if you wanna delete a user from the system? or are you looking for something like this rm -rvf /home/<username>/* . Replace <username> by a valid username in the system which you wanna remove. But I won't recommend the second process.
 
Old 07-04-2012, 03:30 AM   #3
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
this message works ->
Quote:
find . -type f -user edp_user -exec rm -f {} \;
 
Old 07-04-2012, 03:38 AM   #4
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by cbtshare View Post
this message works ->
thx reply ,

I know find works for my case , but it make the server very slow and the server has a huge number of small files, except find , what can i do ?

thx
 
Old 07-04-2012, 03:47 AM   #5
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
well the only other option would be to write a script, and I believe the for statement to delete the files in the script would have the same effect as the find.If the server is slow, I would suggest, manually delete the huge files and then use the find command to delete any other remnants.
 
Old 07-04-2012, 07:06 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,307

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
1. try running the find cmd, but use nice to reduce its priority

2.What might be an idea is to split off finding from deleting ie use the find cmd to list to a file all the files that need deleting, then separately run a delete script (possibly nice-d down) at another time when the system isn't so busy.
 
Old 07-04-2012, 07:08 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,307

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
@Genocide_Hoax: actually easier would be
Code:
userdel -r
http://linux.die.net/man/8/userdel, which also removes the acct & associated mail spool
 
  


Reply


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
Prompt the user for a file to open, extract the XML and write to another text file. richiep Linux - Newbie 7 10-22-2010 03:34 PM
Automatic updating of file on a different machine (server) when user saves a file resetreset Linux - Software 6 03-02-2010 12:32 PM
Create user add file with default password and force user to change it? Morgandy Linux - Newbie 3 02-02-2010 05:06 PM
Create a script that asks the user for a file and then appends the date to the file larry5757 Linux - Newbie 2 12-04-2009 06:33 AM
C user function to check whether a given user has access permission to a file iamjayanth Linux - Software 2 10-07-2009 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration