rm -rf ~/foo
... but executed this instead: rm -rf ~ /foo rm -rf ~/foo
... but executed this instead: rm -rf ~ /foo $ tar cvfz mbox outbox mbox.tar.gz
The argument order is backwards -- the output file is supposed to be first, then the input files.On my system, this overwrote my full mailbox with a gzipped copy of my outbox, and a complaint that the mbox.tar.gz input file didn't exist.
That's right, the worst data loss happened while I was trying to take a backup. :(
Fortunately the University was using some tool that can re-image a computer each time it boots before hitting Windows so starting it back up and all the deleted system and application files were back.
ls /stuff/wherever/*
Then examine the output to see if that is the stuff I really want to delete and if it is,
up-arrow Ctrl-A right right backspace backspace rm -rf enter
Never deleted the wrong stuff again in 30 years of doing that
For example, it will expand `ls *` to `ls foo bar baz`, etc
I stopped it after about 3 seconds, but that was enough to do critical damage.