When permanently delete a file...
...was not what one meant to do.
For sure there are situation in which one wants to delete a file without passing for the recycle bin (temp files, log files, ...), but sometimes you did not mean to cancel that very_important_file.txt.
This happens when working from the console.
The following function...
trash(){ until [ -z "$1" ]; do mv "$1" ~/.local/share/Trash/files/ shift done }
...moves deleted files in the bin rather than permanently delete them; with the alias rm='trash' you can stick to the well-known command.
To use rm without alias invoke it as follows: \rm.
One useful trick to avoid losing the entire directory is having a file in the home directory named -i, this way accidentally executing a rm -rf * in the home, when bash expands * to -i this is interpreted as the -i flag and you have to confirm before deletion
Get the source code here.