They are all painful lessons of blood and tears
I have always heard about deleting databases and running away. Someone deleted the system. I never thought that I would accidentally use rm and accidentally delete the code I wrote for a day. . .
The problem is this: when repeatedly debugging and modifying a certain piece of code, due to laziness in writing scripts , when filters, filter.cpp, filter.h, filter.cpp.bak exist in the directory and filter.cpp.bak needs to be deleted, use tab under rm. Completion When multiple identical prefixes appear, I don’t know who to complete, so rm becomes rm filter* -r. A cool song
trash-cli command line version of the trash
No need for cumbersome scripts, the command line recycle bin can solve the problem, so easy.
sudo apt-get install trash-cli
# sudo vi ~/.bashrc
alias rm='trash-put'
alias rl='trash-list'
alias rr='trash-restore'