Safely move files into a trash can instead of rm
.
OS Independent, as long as your OS supports Python's pathlib
and shutil
.
Now living on Github
$ trash --help
usage: __main__.py [-h] [--trash-dir TRASH_DIR]
[trash_files [trash_files ...]]
...
see the real --help for more
This is mostly for self-educational purposes.
If you actually want a trash utility, see trash-cli which implements the xdg trash specification, so it will play nicely with your Desktop's trash and other tools. It also features more utilities, such as recover.
- CodeReview
- Github Gist
- Github Repository (current home)