logoalt Hacker News

ryandraketoday at 2:08 AM2 repliesview on HN

I don't want to have to type rm --wet-run tempfile.tmp every time, or mkdir -p --yes-really-do-it /usr/local/bin

The program should default to actually doing whatever thing you're asking it to do.

On the other hand it would be great if every tool had an --undo argument that would undo the last thing that program did.


Replies

homebrewertoday at 2:15 AM

That undo program is called nilfs2, which unfortunately never became popular. I'll simply quote the kernel docs:

> NILFS2 is a log-structured file system (LFS) supporting continuous snapshotting. In addition to versioning capability of the entire file system, users can even restore files mistakenly overwritten or destroyed just a few seconds ago.

https://docs.kernel.org/filesystems/nilfs2.html

https://wiki.archlinux.org/title/NILFS2

https://en.wikipedia.org/wiki/NILFS

aapplebytoday at 2:17 AM

Sure, in those cases - but if a command has a chance of nuking prod, you want some extra step in there. Preferably something that can't be muscle-memoried through.