8

Never! ever! EVER!!! run sudo rm -fr * inside your home directory! Hard lesson learned on a Monday :(

P.S it was not intentional at all!

Comments
  • 3
    Why would you do that to yourself dude?
  • 2
    I was in a project folder running a custom Symfony console command. While debugging I had a print_r then an exit. For some strange reason when the script exited it threw me into the home directory.

    The script creates files in the project folder so each run needs to flush it out first. Not cool running it after you realise you are in home :(
  • 3
    Sorry. It happens. Lesson learned.
  • 2
    yeah.. learned that too the hard way. Now when I work on some recursive removal of files in code I copy the whole project directory first..
  • 2
    I usually try to work the file removal into the script itself when I need to do this. This way I can't accidentally do that, and it saves me a tiny bit of time every time I run the script. Best practice has been tying the file removal to a CLI argument.
  • 2
    learned that the hard way, too. Threw me into root usr/bin instead of a local folder. This was 2 weeks into my first project on my university placement year. I feel your pain!
  • 0
    @srichardson I hope you have a backup solution like CrashPlan or TimeMachine. If you don't, get on it right now and thank me later.
  • 1
    @orion-ix yeah I had time machine although s month old. It was good enough to get back the important files.
  • 1
    That's good, at least you have something. But I'd suggest CrashPlan because it lets you backup to another machine you own. I've recently just got it and regular backups automatically done across two sites whenever I turn on my laptop.
  • 1
    Will need to look into that, sounds good. At present I have time machine running to an external drive. It quickly becomes full so I end up deleting old backups.

    The deleting process can take forever sometimes so when I don't have time I disable time machine to stop the notifications. That's why my last backup was a month old. (Busy month 😂)
  • 0
    @srichardson yeah I completely get where you're coming from. And leaving your portable drive a plugged in is not viable anymore because of these ransomwares that go around encrypting all your data. And backup is a chore, so if you have any way to automate the process, do it. But I still recommend a monthly backup to your portable drive just for redundancy.
Add Comment