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.
What is trash-cli
trash-cli
is a Python tool that implements the freedesktop.org trash specification. In contrast to rm
, users can recover deleted files easily.
Installing trash-cli
The recommended way to install trash-cli
is through pip
(the Python package manager):
|
|
Alternatively, trash-cli
is available on some package managers:
Debian/Ubuntu:
|
|
Arch:
|
|
Fedora:
|
|
trash-cli
simple usage
Using trash-cli
is straightforward.
Trash a file:
|
|
Trash many files:
|
|
List trashed files:
|
|
Remove specific trashed files:
|
|
Restore trash:
|
|
Lastly, emptying trash:
|
|