Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was testing a file IO thing, and accidentally hit an infinite loop. I was able to stop it relatively quickly (only about 23k files were created). It happened on my Desktop, and when I try to view my computer, it just freezes up and I can't do anything after about 30 seconds. I wrote a script to fix it:

Dir.glob "*".grep /\d/.each do |f|
  system("rm #{f}")
end

but that freezes as well. Is there any way to fix it?

share|improve this question
    
What's the OS? Try running fsck on Unix/Linux or chkdsk on windows first –  Dougvj Jul 21 '12 at 5:14
1  
@Dougvj The question is tagged OSX. –  Thomas Jul 21 '12 at 5:59
    
I don't know much about OSX, but is it possible to log in to a text mode shell rather than the graphics environment? –  Mr Lister Jul 21 '12 at 6:10
    
@MrLister: yep, it's call Single User mode, invoked by holding down CMD+S when you hear the gong while booting. It gives you a root shell but you need to follow the on screen instructions to get the file system mounted write-enabled. –  Deditos Jul 21 '12 at 11:20
    
OK, and do you have any file alteration monitors running then, like famd? Because I'm guessing that is part of the problem. –  Mr Lister Jul 21 '12 at 12:34
add comment

1 Answer

You may want to try inserting your Mac OSX install CD. If you boot from it, you should be able to open up a terminal window. From there you can use the command

rm -f /Users/[YourUserName]/desktop/*

That will remove everything on your Desktop without asking "Are you Sure?". Make sure you select the right path, else you may delete very important files.

If you have files on your desktop that you need to keep, use the command

mv /Users/[YourUserName]/desktop/[Filename] /Destination/Path/Here

That will move those files you want to keep to the path specified at the end of the command.

Again, be very careful using the rm -f command. It will remove files without asking if you're sure, including important system files. That's why it's important you double and triple check you have the appropriate directory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.