Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}")

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
@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

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

When booting up your Mac, hold command+s this will take you into single user mode. Type the following to mount the file system:

mount -uw /

After that:

rm -f /Users/[username]/Desktop/*

You won't have to have the Mac OS X install DVD this way

share|improve this answer

Your Answer


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.