12
aaijmrt
7y

Just ran rm -rf ~

Only good thing is I ran it without sudo.

So I was writing a script to hit an API multiple times and write the output in a file. Instead of providing the absolute path like /User/.... I gave the path as ~/..., So it created a folder named ~ inside the directory I was inside. Now I wanted to delete it and the file inside it. And so I did it.

I am an idiot

Comments
  • 3
    @IllSlapU yeah. A hard lesson learned 😓
  • 1
    since this is your home directory: why do you need sudo? also: does rm -rf ./~ work as expected?
  • 0
    @romangraef the command removed files/folders which were owned by the user I was logged in with. I generally don't use the admin account. So a lot of important things were not removed.
  • 0
    @aaijmrt yeah but your home drive generally should contain stuff that is owbed by the current user.
  • 0
    @romangraef and most of it was. But some were not. The owner of such files was the admin user.
Add Comment