this post was submitted on 07 Nov 2024
21 points (100.0% liked)

Technology

966 readers
4 users here now

A tech news sub for communists

founded 2 years ago
MODERATORS
 

I was doing command line stuff while tweaking on coffee and having a bit of an anxiety attack and I accidentally deleted my home directory.

But I have automated daily snapshots saved which is a ZFS feature. And I was able to simply restore from the latest snapshot which was from this morning. So this is the first time ever that I got any benefit from being on ZFS.

you are viewing a single comment's thread
view the rest of the comments
[–] bennieandthez@lemmygrad.ml 6 points 1 week ago (2 children)

how does one sccidentally delete home directory? I know that it happens but how!

[–] ksynwa@lemmygrad.ml 5 points 1 week ago (2 children)

The gist is this:

  • I was using a terminal file manager called nnn
  • You can make bulk selections in it using the space key
  • However, unlike a graphical file manager, selections across directories persist. Like if you select some things in dir1, then traverse to dir1/.. and select stuff there, the selections in dir1 will persist. In hindsight this sounds like an antifeature.
  • Due to frantic key presses I accidentally traversed to /home and selected /home/name
  • Then I traversed to the actual directory where I wanted to make the selections, did that and deleted the selections
  • It was unknown to me that /home/name was also selected
  • nnn just executes shell commands to perform deletions. In my shell profile rm is aliased to rm -iv so the output conveyed to me what was going on (my home directory was being nuked)
  • I ctrl+c'd the operation and restored my $HOME from the snapshot
[–] multitotal@lemmygrad.ml 9 points 1 week ago (1 children)

A cautionary tale for all those out there who wish to use meme software.

[–] ksynwa@lemmygrad.ml 3 points 1 week ago (1 children)

It's pretty good when it's not nuking your $HOME

[–] multitotal@lemmygrad.ml 5 points 1 week ago (2 children)
[–] ksynwa@lemmygrad.ml 7 points 1 week ago (1 children)

Here is why setup is superior:

  • sunk cost fallacy
[–] multitotal@lemmygrad.ml 2 points 1 week ago

Yup, I know the feeling. That's why it can be nice to start fresh with a new installation or new distro.

[–] bobs_guns@lemmygrad.ml 4 points 1 week ago

Asahi Lina proves this. Utterly incomprehensible system programming streams

[–] GrainEater@lemmygrad.ml 5 points 1 week ago (1 children)

I'd recommend installing trash-cli or something equivalent as well

[–] bennieandthez@lemmygrad.ml 2 points 1 week ago

i will do so, didn't know about it 👍

[–] davel@lemmygrad.ml 2 points 1 week ago

I’ve done it, more than once. There are infinitely many ways to do it. I use trash-cli instead of rm(1) now.