The command "rm -rf ~/blue/" is just a single space key from being equivalent to "rm -rf /" with "rm -rf ~/blue /"
"rm -rf ~/blue /" will not come close to deleting / unless you are in the habit of running every command as sudo, even ignoring the presence of --no-preserve-root
$ cd dir where there are source files and temp files
$ rm *.tmp # or so you think
'.tmp not found'
# too bad1. You type it into the wrong system (D'oh)
2. You have run `mount --bind / /somewhere/else` then `rm -rf /somewhere` a week later
:(
Every few days I remind myself of this.... then I have to delete another directory with a git repository in it, and end up add the -f in again
rmgit()
{
git status
read -p "Are you sure? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
rm .git -rf
fi
}Premature enter just results in:
[web@server /]$ rm ~
rm: cannot remove `/home/web': Is a directory
Such as this classic:
https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commi...
$ cp -r path/to/some/directory path/to/very/important/directory
$ (run some commands to verify copy did what I wanted)
$ rm -r path/to/some/directory path/to/very/important/directory
Of course, all I had meant to do was delete `path/to/some/directory`, but I just pressed 'up' in my history and switched `cp` to `rm`. Of course I hit Ctrl-C in an instant, but my FS was already hosed...Fortunately, despite rm's poor choice of options and bash's poor default handling of variable name typos and the obvious PEBKAC, backups saved the day here.
People are human. Policy ought to reflect this.
rm -rf *
in their shell history? Now it's just one accidental twitch away.