Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-05-2004, 01:32 PM   #1
latinasojourn
Confirmed User
 
Join Date: Oct 2003
Posts: 3,191
question for server guru---how to delete folder with many files

i want to do some cleanup on our servers.

specifically delete the folders that contain several hundred thousand small jpg files of TGP thumbs.

i will use SSH

now when i use regular "rm" command it times out.

what's the easy way to do this---what is the command line?

(delete the folder and all files in it---there might be 100K individual small jpg files within the "thumbs" folder)

thanks to anyone who knows!
latinasojourn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:34 PM   #2
X37375787
Guest
 
Posts: n/a
rm -rf folder/

???
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:34 PM   #3
AndrewKanuck
Confirmed User
 
Join Date: Jan 2004
Location: Cleveland & Atlanta
Posts: 6,706
rm -rf foldername

If that gives you an error about too many files do it quick and dirty

bash
for i in `ls`
do
rm -rf $i
done

and wait
__________________
AndrewKanuck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:36 PM   #4
X37375787
Guest
 
Posts: n/a
dont see how rm-rf would have trouble with anything. you can delete your entire harddrive if you want with that command
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:36 PM   #5
AndrewKanuck
Confirmed User
 
Join Date: Jan 2004
Location: Cleveland & Atlanta
Posts: 6,706
Quote:
Originally posted by AndrewKanuck
rm -rf foldername

If that gives you an error about too many files do it quick and dirty

bash
for i in `ls`
do
rm -rf $i
done

and wait
Quick note - only do that bash script inside the folder that you're trying to remove - don't do it from... say / or /home or anything crazy like that.

The smart thing would be to hire a server admin if you don't understand that concept tho
__________________
AndrewKanuck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:37 PM   #6
AndrewKanuck
Confirmed User
 
Join Date: Jan 2004
Location: Cleveland & Atlanta
Posts: 6,706
Quote:
Originally posted by Equinox
dont see how rm-rf would have trouble with anything. you can delete your entire harddrive if you want with that command
I've had rm issues before where the filecount was too large - say if you were doing rm *.jpg - or in my case, I was deleting all locked messages in my spam folder (about 450,000 of them)
__________________
AndrewKanuck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:39 PM   #7
xenophobic
Confirmed User
 
Join Date: Mar 2004
Location: Dallas
Posts: 874
or just
find . -type f -exec rm {} \;

two curly braces replaced by stupid board.

you would have to do it in the directory you want all the files removed.

Last edited by xenophobic; 12-05-2004 at 01:40 PM..
xenophobic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:43 PM   #8
xenophobic
Confirmed User
 
Join Date: Mar 2004
Location: Dallas
Posts: 874
Quote:
Originally posted by Equinox
dont see how rm-rf would have trouble with anything. you can delete your entire harddrive if you want with that command
because the file count exceeds the maximum argument length from the kernel.
xenophobic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:46 PM   #9
smashface
Confirmed User
 
Industry Role:
Join Date: Sep 2002
Location: San Francisco, California
Posts: 991
What about

cp /dev/null /folder
smashface is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:46 PM   #10
latinasojourn
Confirmed User
 
Join Date: Oct 2003
Posts: 3,191
thanks you guys.


OK, so in other words i,


cd to the thumbs directory


and then type the command below?:


rm -rf folder/
latinasojourn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:53 PM   #11
SinSational
Confirmed User
 
Join Date: Oct 2004
Location: Boston, MA
Posts: 1,723
yes, if you want to clean out /thumbs then do

rm -rf *

that will empty it
__________________

ICQ# 273099174 - monthly specials - 2 Month Free Credit on All Plans - 100% Referrals - chris@ for details
Virtual from $14.95/month, Dedicated from $149.95/month
Dual-Core Xeon > 1000GB @ $149.95 | 1500GB @ $169.95 | 10Mbps @ $269.95

Last edited by SinSational; 12-05-2004 at 01:55 PM..
SinSational is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2004, 01:58 PM   #12
LikeWhoa!
Registered User
 
Join Date: Jun 2004
Location: Right At Home
Posts: 72
MAKING SURE YOURE IN THE "THUMBS" DIR BEFORE YOU DO THE ABOVE
LikeWhoa! is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.