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.

Some background to maybe help others from making this mistake.

I was reading jokes from this Stack Overflow page to my friend (http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke?page=2&tab=votes#tab-top) and I was going through them pretty quickly. Saw the one with Russian Roulette, and since I was talking to my friend I was distracted and didn't read the comments below it. I thought it was just going to say "Click" if you lost. Never even imagined someone would have put "rm -rf /" in there. Copied and pasted it into terminal, glanced over it quickly but somehow my eyes missed the delete command (you don't see what you're not looking for).

Anyway, as soon as I saw a scrolling list of files, I realized something was wrong and hit Ctrl+C. In other words, about 0.2 seconds later.

The last item it got to was:

rm: /Applications/iPhoto.app/Contents/PlugIns/HTMLExporter.iPhotoExporter/Contents/Resources/cs.lproj/Panel.nib: Permission denied

I assume that for most of these things you have to be root to delete, but it did take out Google Chrome. Luckily, it didn't get any of my user files.

So since I don't know what got lost, could someone tell me if "Applications" is the first directory in "/" on OS X or are there any directories that would have gotten wiped out before it? Anything important in Applications that is on OS X by default (that doesn't require root to delete)? Does rm remove things alphabetically?

Thanks for checking for me

(In case you're wondering, I only backup ~ since it's the only directory I keep my important files in.)

share|improve this question

closed as too localized by nerdwaller, Dave M, 8088, Renan, KronoS Apr 17 '13 at 17:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
... Oh, just ow. you did back up, didn't you? –  Journeyman Geek Apr 17 '13 at 7:52
add comment

2 Answers 2

up vote 2 down vote accepted

Yes /Applications is the first directory. Just checked (bash shell) that the file expansion is alphabetic and it is so.

This similar command (not as painful but file expansion should be the same)-:

ls -1R /

Lists all the files in / then all the files in /Applications. So any files in / would have been clobbered before it started on files in /Applications. Listing follows. Hope that helps.

/Applications:
Adobe
App Store.app
Automator.app
BBC iPlayer Desktop.app
Calculator.app
Calendar.app
Chess.app
Contacts.app
DVD Player.app
Dashboard.app
Dictionary.app
DroidDraw.app
Dropbox.app
Eclipse.app alias
EditNewFile.app
FaceTime.app
FileZilla.app
Firefox.app
Font Book.app
Game Center.app
GarageBand.app
GitHub.app
Google Chrome.app
Image Capture.app
Launchpad.app
Mail.app
Messages.app
Mission Control.app
Notes.app
OpenOffice.org.app
Opera.app
Opera_12.14_Setup_Intel.dmg
Photo Booth.app
Pixelmator.app
Preview.app
QuickTime Player.app
Reminders.app
Safari.app
Skype.app
Skype_old.app
Stickies.app
System Preferences.app
TextEdit.app
TextWrangler.app
Time Machine.app
Utilities
Xcode.app
eclipse 2
iDVD.app
iMovie.app
iPhoto.app
iTerm.app
iTunes.app
iWeb.app
share|improve this answer
    
Thank you very much! –  Nick Apr 19 '13 at 3:05
add comment

There's a very similar question in the context of a particular subdirectory (not /) on SuperUser (Can I list file names (or their parent directories) that were recently deleted using rm in OS X?) that's answered by using find to check modification dates.

find / -type d -mtime -1 > modified_folders.txt

However there's a much more thorough entry on AskDifferent.

share|improve this answer
add comment

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