Suicide Linux (2011)
qntm.org
qntm.org
I think the general concept is sometimes called "DWIM" (Do What I Mean).
Perhaps with something like "really" (where usage is similar to sudo) that would both override and train the fuzzy guessing. Training times might be a problem, even with a good algorithm, but perhaps if you got enough people to donate bash histories.
I must commit rm -rf /
All that aside every unix person who wipes a box for a reinstall should try rm -rf / and see what works and what doesn't. It teaches you a lot about shell builtins, filesystem dependencies, binaries still running and thus hanging around in /proc & its equivalents (which can save you), and weird stuff like /dev/tcp/ and /dev/udp/ (if your shell has them and they're enabled). A Linux or BSD machine can often be recovered live from deleting everything but /home, say.
Indeed. Although I would argue that since we are talking about Suicide Linux, you would in all likelihood need the flag
Might help in a few cases, but would lul people into a false sense of security.
Maybe we should call it "selinux"
https://www.dragonflybsd.org/hammer/
"HAMMER retains a fine-grained history. The state of the filesystem can be accessed live on 30-60 second boundaries without having to make explicit snapshots, up to a configurable fine-grained retention time.
A convenient undo command is provided for single-file history, diffs, and extractions. Snapshots may be used to access entire directory trees."
edit:
Just now, 10 minutes after posting this, I regretted deleting a file (cabal.sandbox.config) and was able to restore it:
> rm cabal.sandbox.config // oops
> undo -i cabal.sandbox.config
cabal.sandbox.config: ITERATE ENTIRE HISTORY
0x000000010bf2e940 17-Apr-2015 06:50:48
0x0000000112282990 18-Apr-2015 20:36:53
> undo -t 0x0000000112282990 -o cabal.sandbox.config cabal.sandbox.configI'm not really sure how to benchmark it myself, those are from 2012 and I'm sure things have improved since then.
Ever tried to clear the current directory with rm? It's actually amazingly tricky and dangerous to wipe out dot files without moving up directories. Whereas find has the benefit of saying exactly what it'll do before it does it (and being a bit faster IMO).
The thing I'm really missing in find is a native -chown and -chmod flag now.
rm -rf *~
I typed rm -rf * ~
At least I learnt to use -rf more carefully. Way more carefully.EDIT: not sure why this is being down-voted. It's just an idea, albeit possibly a bad one.
$ rm -rf /
rm: it is dangerous to operate recursively on ‘/’
rm: use --no-preserve-root to override this failsafeIf you add special exceptions for things like "rm -rf /" then you start to wonder, why not add exceptions for other dangerous things, like "find / -delete" and "rm -rf /usr".
In general, most of the basic Unix tools operate off of relatively simple first principles and don't contain exceptions for things like this.
That is, until I installed some version of Red Hat that aliased rm to "rm -i", and extracted a few wrong tar files. Then I understood why the shell is that way, and why everybody just clicks "ok" on Windows dialog boxes without reading the alerts. Funny thing is that I lost some important files because I expected the prompt, but pressed "y" 19 times, instead of 18...
Nowadays I Just do backups.
Case in point, a unix novice coworker of mine came up to me once and said, I think I might have done something wrong. I'm trying to remove an empty directory and it's hanging. Turned out he created a directory in whatever linux workspace gui he was running at the time and accidentally added a space at the end. He didn't notice until he used terminal `ls` to look at it and then noticed it printed like this (with `ls -F`):
somedir /
So he decided to rm it and start over. Can you guess what he typed?cd $TempDIR
wget http://example.com #Do stuf in temp dir
rm -R . #Clean Tempdit
if $TempDIR is not set, it will delete your home directory.
If $TempDIR does not exist or the cd somehow fails it will delete your current folder.
It's funny how many of us would never use a weakly/stringly typed language to handle our important data, but then we happily use bash to deploy or manage the systems on which our apps run.
edit: maybe install it as a prank on your colleagues VMs