LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   accidental "cd Desktop; rm -rf ", now everything is sloooww.. (https://www.linuxquestions.org/questions/slackware-14/accidental-cd-desktop%3B-rm-rf-now-everything-is-sloooww-778197/)

slide77 12-26-2009 11:30 AM

accidental "cd Desktop; rm -rf ", now everything is sloooww..
 
I'm so embarrassed. I've been using Slackware for nearly ten years. I'm no guru but I've never accidentally deleted anything. I was writing a script to:
cd ~/Desktop/
mkdir stuff
[do things]
cd stuff
rm -rf *

I misspelled the "stuff" in "cd stuff" so it did "rm -rf *" while in the Desktop directory.

Now everything runs slowwwww. Opening a text file takes a few seconds and when I click on the X to close a window, it also takes a few seconds.

I'm on Slack 12 and need to upgrade anyway but won't have time for a few days. Is there something in the Desktop directory that would cause everything to run very slowly? I can hear my cpu fan running, which only happens under a heavy load, but I have tons of free memory and top doesn't show anything unusual.

Also, tried restarting X and rebooting but it still acts slow. (sorry for a bunch of edits, I'm having trouble posting this because it hung and somehow accidentally hit "submit" while typing)

slide77 12-26-2009 11:46 AM

Oh good grief, nevermind. I had a script that runs in a "while true" loop to restart another script in case it crashes. The second script was on the Desktop so the loop was dragging everything down, not to mention generating a nice big error log.

Is there anything else important on the Desktop that might cause errors after being deleted or should I be safe until I can upgrade?

moonfrog 12-26-2009 02:38 PM

You should be ok.
By default there's nothing in Desktop but links to folders and trash.
Consider that an important lesson though.

Erik_FL 12-26-2009 02:49 PM

Quote:

Originally Posted by slide77 (Post 3805310)
Oh good grief, nevermind. I had a script that runs in a "while true" loop to restart another script in case it crashes. The second script was on the Desktop so the loop was dragging everything down, not to mention generating a nice big error log.

Is there anything else important on the Desktop that might cause errors after being deleted or should I be safe until I can upgrade?

When you're going to run a script in a loop to execute something, it's a good idea to test to see if the file exists. If the file doesn't exist or you just restarted some process, then have the script sleep for a while. Then even if the problem can't be resolved, it won't hog the CPU.

I get lazy sometimes writing shell scripts (I don't write them often) and get bitten by that sort of problem myself.

slide77 12-27-2009 12:02 AM

Thanks all, everything seems to be fine. I've never paid any attention to those .desktop files or anything else associated with it and didn't know if there was anything important there. I knew I could create a new user with a new Desktop but I've been wanting to repartition hda and do a fresh install/upgrade anyway so this is a good excuse.


All times are GMT -5. The time now is 07:58 PM.