Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help Deleting a folder
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jsias99
n00b
n00b


Joined: 17 Feb 2005
Posts: 30
Location: Somewhere in Texas

PostPosted: Mon May 23, 2005 3:15 pm    Post subject: Help Deleting a folder Reply with quote

Hi guys this question is going to sound really newbish, and im sorry for that. I have a script running on the machine it checks email on the pop server and saves it locally on the imap server. but i was leaving out of town and i messed with the script a little forgot to chack my emails and it was saving 154 email every minute, onto my .maildir, i tried deleting the NEW mail folder in the .maildir but everytime i try it it brings the machine down to its knees, any other way i was just trying

rm -r folder name

any help is welcomed thank you guys.

P.S. Sorry im such a noob
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon May 23, 2005 3:26 pm    Post subject: Reply with quote

Can you do anything with the directory, like ls? If not, you could try using nice with rm to see if that helps.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
jsias99
n00b
n00b


Joined: 17 Feb 2005
Posts: 30
Location: Somewhere in Texas

PostPosted: Mon May 23, 2005 3:28 pm    Post subject: Reply with quote

well everytime i try ls or anything the machine just ends up going to its knees, how do you use nice, im sorry im really new.
Back to top
View user's profile Send private message
blue.sca
l33t
l33t


Joined: 28 Aug 2003
Posts: 680
Location: Mainz, Germany

PostPosted: Mon May 23, 2005 3:44 pm    Post subject: Reply with quote

you could do
Code:
ls -la .maildir | wc -l
so we can see how many files there are about.
Code:
nice -n 5 rm -r .maildir
should allow the machine to react on user input. you can try any numbers from 19 to -19 where as lower the number is, the more priority the command gets. 0 is default.
_________________
geek by nature, linux by choice
i want my avatar back... thank you
:wq
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Mon May 23, 2005 3:50 pm    Post subject: Reply with quote

it happened to me when i had tons of files in a single directory accidentally. My solution was to delete the files partially at each rm command. cd into the directory and issue 'rm 1*' to remove all the files starting with 1, and then 'rm 2*', 'rm a*' and so on.
Back to top
View user's profile Send private message
jsias99
n00b
n00b


Joined: 17 Feb 2005
Posts: 30
Location: Somewhere in Texas

PostPosted: Mon May 23, 2005 3:56 pm    Post subject: Reply with quote

so i just type in rm 1 - 0 and rm a-z and A-Z will it work?
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Mon May 23, 2005 3:58 pm    Post subject: Reply with quote

Code:
rm [0-9]*
rm [a-z]*

will work, but if it is mail then probably most of them start with the same letter
Back to top
View user's profile Send private message
jsias99
n00b
n00b


Joined: 17 Feb 2005
Posts: 30
Location: Somewhere in Texas

PostPosted: Mon May 23, 2005 4:12 pm    Post subject: Reply with quote

well i tryed that it didnt work, any other ideas it kept telling me no file name
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon May 23, 2005 4:23 pm    Post subject: Reply with quote

jsias99 wrote:
well i tryed that it didnt work, any other ideas it kept telling me no file name
Using nice didn't help? I vaguely recall a similar topic... I'll see if I can find it.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
flash49
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 233

PostPosted: Mon May 23, 2005 5:07 pm    Post subject: Reply with quote

BlackEdder wrote:
Code:
rm [0-9]*
rm [a-z]*

will work, but if it is mail then probably most of them start with the same letter

No, it probably won't work, because:
[0-9]* means "all files starting with a number" and this are too many files to fit in one bash command line. Probably "rm 0*" won't work either...

:!: But whatever you are doing, your Computer has to create a list of all files in this directory, so your best option is to delete the NEW directory with "nice -n 20 rm NEW" and accept the consequences. :(

If the "nice -n 20 rm NEW" does not work, try this:
Code:
find NEW |xargs -n1 rm

For a first test you can substitute the "rm" with "echo"
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon May 23, 2005 5:26 pm    Post subject: Reply with quote

flash49 wrote:
If the "nice -n 20 rm NEW" does not work
Try 'rm -rf', since rm doesn't remove directories automatically ;).
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
jsias99
n00b
n00b


Joined: 17 Feb 2005
Posts: 30
Location: Somewhere in Texas

PostPosted: Mon May 23, 2005 9:25 pm    Post subject: Reply with quote

flash49 you are my hero i tried it with your nice command and it worked the machine has deleted about 20 gigs and no sing of slowing down, you guys are great.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum