3 ms·
A problem with most commands is that they usually don't need extremely-unfortunate typos or russian-roulette-enabled shells to turn into something wrong: they a
by remram 6y ago
A problem with most commands is that they usually don't need extremely-unfortunate typos or russian-roulette-enabled shells to turn into something wrong: they are usually wrong in passing, while you're typing them. I always wondered if something could be done against the effects of an accidental premature return. Some of us have cats...
`sudo rm -rf /tmp/workdir` starts with `sudo rm -rf /`
`git reset libs` starts with `git reset` which will wipe your staging area
`docker-compose rm -f db` starts with `docker-compose rm -f` which will remove all stopped containers (and their logs)
Most commands just tend to do something very broad with no arguments, and the fact that paths start with bigger folders and go down to files doesn't help either. No GUI tool would ask you to confirm before you type in the path, the way shell commands tend to.
- cobbzilla 6y agoMy favorite is: rm -rf ${DIR_NAME}/* Then you remember that DIR_NAME is undefined...
- DoofusOfDeath 6y agoI typically put "set -o nounset" at the top of my Bash scripts.
- cobbzilla 6y agoMy solution is to always install safe-rm. It prevents a lot of dumb deletes.
- account42 6y agoValve did exactly that in Steam for Linux at some point. [0] [0] https://github.com/valvesoftware/steam-for-linux/issues/3671 https://github.com/valvesoftware/steam-for-linux/issues/3671
- NoodleIncident 6y agoI've seen a few platformers that force you to jump at random times, screwing up what you planned on doing. You could definitely make a device to plug in as a keyboard that sporadically hits "return"
- wang_li 6y agoI don’t know why people insist on planting land mines. There is a tool for managing workgroup arrays called foo. Among its many operations it had: $ foo reset array $ foo reset array controller a|b The first one resets to factory defaults. The second reboots one of the redundant controllers, a or b. We had to reconfigure and restore from tape several times. In zfs the command to create a dataset is “zfs create toplevelname/datasetname”. The command to create a snapshot is “zfs snapshot datasetname@snapshotname”. The command to destroy either is “zfs destroy objectname”, and the objectname of a snapshot is always a valid dataset name plus an at sign plus the snapshot name. Deleting a dataset is not a reversible operation. :/
- unionpivo 6y agoThats why you always do (does not work on BSDs) rm WHATEVER -rf