Last updated on March 23, 2019
Tired of accidentally deleting documents using rm?
Create a file /usr/local/bin/trash-rm and paste this content
Next, we add alias in ~/.bashrc
Now, run command
and we are good to go.
Now, every time you use rm command, it will create a trash directory and move the content to that directory.
Funny, it will throw error if you try to rm trash itself.
Everything is awesome.