5
Tried to run my first Python script and ended up deleting my desktop instead
Last Tuesday I was following a tutorial about making a simple calculator in Python. I got to the part where you run your code in the terminal and somehow typed 'rm -rf ~' instead of 'python calc.py'. Next thing I know, all my desktop files vanished including that picture of my cat I took 3 years ago. Took me an hour to figure out how to restore things from the recycle bin. My friend who's been coding for 5 years said he did the same thing when he started. Has anyone else accidentally nuked their own computer while learning?
2 comments
Log in to join the discussion
Log In2 Comments
veramartin15d ago
oh man i did the same thing with rm -rf / on my old mac. turns out there's a reason people say alias rm='rm -i' in your bashrc. trust me on this one, put some safety aliases in your profile file now.
3
lilys8115d ago
Oh geez @veramartin, that's rough. Aliasing rm to rm -i saved my bacon more times than I care to count. Its one of those basic things people skip until they really regret it. I've got it set up on every machine I touch now, no exceptions. It feels like a no brainer but I still see folks running without it. Takes two seconds to add and saves you from total disaster.
4