View previous topic :: View next topic |
Author |
Message |
jsias99 n00b
Joined: 17 Feb 2005 Posts: 30 Location: Somewhere in Texas
|
Posted: Mon May 23, 2005 3:15 pm Post subject: Help Deleting a folder |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon May 23, 2005 3:26 pm Post subject: |
|
|
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 |
|
|
jsias99 n00b
Joined: 17 Feb 2005 Posts: 30 Location: Somewhere in Texas
|
Posted: Mon May 23, 2005 3:28 pm Post subject: |
|
|
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 |
|
|
blue.sca l33t
Joined: 28 Aug 2003 Posts: 680 Location: Mainz, Germany
|
Posted: Mon May 23, 2005 3:44 pm Post subject: |
|
|
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 |
|
|
alkan Guru
Joined: 06 Aug 2004 Posts: 385 Location: kasimlar yaylasi
|
Posted: Mon May 23, 2005 3:50 pm Post subject: |
|
|
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 |
|
|
jsias99 n00b
Joined: 17 Feb 2005 Posts: 30 Location: Somewhere in Texas
|
Posted: Mon May 23, 2005 3:56 pm Post subject: |
|
|
so i just type in rm 1 - 0 and rm a-z and A-Z will it work? |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Mon May 23, 2005 3:58 pm Post subject: |
|
|
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 |
|
|
jsias99 n00b
Joined: 17 Feb 2005 Posts: 30 Location: Somewhere in Texas
|
Posted: Mon May 23, 2005 4:12 pm Post subject: |
|
|
well i tryed that it didnt work, any other ideas it kept telling me no file name |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon May 23, 2005 4:23 pm Post subject: |
|
|
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 |
|
|
flash49 Apprentice
Joined: 12 Feb 2005 Posts: 233
|
Posted: Mon May 23, 2005 5:07 pm Post subject: |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon May 23, 2005 5:26 pm Post subject: |
|
|
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 |
|
|
jsias99 n00b
Joined: 17 Feb 2005 Posts: 30 Location: Somewhere in Texas
|
Posted: Mon May 23, 2005 9:25 pm Post subject: |
|
|
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 |
|
|
|