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 01-18-2010, 01:48 AM   #1
guessity
Member
 
Registered: Dec 2009
Posts: 41

Rep: Reputation: 15
Question Easiest way to mass delete files without crasing server?


I have like over 60 gb of tons and tons of tiny tiny files.

I used
Code:
rm -rf *
and I ended with system load of over 100+.

Any idea how do I mass remove the files without crashing the system? I have Q9550 with 8 gb ram.
 
Old 01-18-2010, 02:09 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
So remove by date, user, size or name this may give you the chances to remove the whole files step by step.
 
Old 01-18-2010, 02:27 AM   #3
AutoBot
Member
 
Registered: Mar 2002
Location: I can see you from here.
Distribution: Gentoo 1.3b
Posts: 184

Rep: Reputation: 34
To my knowledge there is no good way to get around this. If this is going to be a continuous problem then I would use reiserfs on a separate partition for these files...reiserfs is good with many small files.

There are benchmarks around for deletion time for lots of files on different filesystems.
 
Old 01-18-2010, 04:01 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Part of the problem is that the asterisk expands to all of the files in the current directory. The filenames are also sorted before being added as command line arguments.

You could run:
find . -type f -delete
find . -type d -empty -delete
find . -type d -exec rm -r '{}'

The second line could be run repeatedly instead. The third line could be run instead of the second line.
 
  


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
Can I delete files in /mnt/tmp? and Files in the trash can will not delete? M$ISBS Slackware 15 10-03-2009 12:56 AM
rsync not delete non existing files on remote server proNick Linux - Software 2 09-10-2008 04:47 AM
Server-friendly way to delete MANY tiny files? ToBe Linux - Server 3 03-08-2007 01:59 PM
delete files in server that is older than 30 days using cronjob latheesan *BSD 2 06-14-2005 01:37 PM
Files delete from SAMBA server klmn1 Linux - General 2 04-17-2004 03:34 AM

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

All times are GMT -5. The time now is 07:35 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