rm is a great tool that gives users enough power to inadvertently erase data. While the data may be recoverable, there is a tool that gives users recycle bin behavior.
trash-cli is a Python tool that implements the freedesktop.org trash specification. In contrast to
rm, users can recover deleted files easily.
The recommended way to install
trash-cli is through
pip (the Python package manager):
trash-cli is available on some package managers:
trash-cli simple usage
trash-cli is straightforward.
Trash a file:
Trash many files:
List trashed files:
Remove specific trashed files:
Lastly, emptying trash: