When you use rm
in the Linux console, you can delete a file without any confirmation message validating that this is really what you wanted to do.
To fix this, many programmers use the alias alias rm="rm -i"
to ensure that a confirmation message always pops up. The problem with this workaround is that you get used to using rm
without any flags and end up using it the same way when working on another console where the same alias does not exist. And, let's be honest, you don't even notice that no confirmation message popped up... if you make a mistake, bye-bye file.
The best solution for this is to get in the habit of always using a flag: normally rm -i
or rm -f
when you feel brave and want to delete without a confirmation message. That is what this Gist is for. It's like the little wheels on children's bicycles so they don't fall off, once they know how to ride, they can ride without it.
If you paste the code of this Gist in /bin/rmflag.sh
and create t