So the other day, I saved a big object to a file during a debugger session with a path like ~/debug.json only to find out later that the debugger didn’t support shell expansions and instead of saving to the home directory it had literally saved the file under a directory called ~ inside my project. Now at that point I didn’t need the file anymore anyway, so you never guess what I proceed to do next, and mind you now I was in my regular terminal: I ran rm -rf ~. Lost a bunch of dot files, but thankfully all the permission errors I got made me realize what was going on and I cancelled the operation quickly before any bigger damages were done.
So the other day, I saved a big object to a file during a debugger session with a path like
~/debug.jsononly to find out later that the debugger didn’t support shell expansions and instead of saving to the home directory it had literally saved the file under a directory called~inside my project. Now at that point I didn’t need the file anymore anyway, so you never guess what I proceed to do next, and mind you now I was in my regular terminal: I ranrm -rf ~. Lost a bunch of dot files, but thankfully all the permission errors I got made me realize what was going on and I cancelled the operation quickly before any bigger damages were done.Oh yes, the classic
rm -fr ~I wouldn’t be surprised if current AI models would try to do the same command for deleting a folder named ~Another fun one is
rm -fr .*if you want to delete dotfiles (hint:..).Sometimes it’s just better to open the file manager, select files and hit delete manually.
Linux in a nutshell
🎸 Linux power 🎸
The leading
./to operate on a file in thecwdhas saved me a lot of headaches, I’m sure.It’s a sad day when you realize your biggest enemy is yourself.