A simple, cross-platform, command line move-to-trash.
But why?
The delete command is a simple alternative to using the standard rm command. Using rm as a matter of course can be dangerous and prone to mistakes. Once a file is unlinked with rm it cannot be recovered (without having backups).
All major graphical environments offer a “move to trash” option. This does a clean move operation to a “trash” folder. Once a file as been put in the trash it can be recovered easily. Periodically, the trash can be emptied if desired.
delete is a command line implementation of this metaphor. It maintains a basic sqlite3 database of files and folders put in the trash. Using the --list option will list the contents. Using --restore will restore a file or folder from the trash. Using --empty will purge anything put in the trash by delete.
Installation
If you already have Python 3.7 on your system, you can install delete using Pip.
pip install delete-cli
Basic Usage
Calling delete with no arguments or with the --help flag yield typically Unix style behavior, print a usage or help statement, respectively. For detailed usage and examples you can read the manual page, man delete.
Deleting files and folders is as simple as:
delete file1.txt file2.txt folderA
Files or folders that get deleted with the same basename will have a suffix added before the extension (e.g., file1.1.txt, file1.2.txt, …).
Restore files using their basename (in the trash), their full path (in the trash) or their original full path.
Documentation
Documentation is available at delete-cli.readthedocs.io. For basic usage information on the command line use: delete --help. For a more comprehensive usage guide on the command line you can view the manual page with man delete.
Contributions
Contributions are welcome in the form of suggestions for additional features, pull requests with new features or bug fixes, etc. If you find bugs or have questions, open an Issue here. If and when the project grows, a code of conduct will be provided along side a more comprehensive set of guidelines for contributing; until then, just be nice.
Metadata
Release files for delete-cli 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| delete-cli-1.1.3.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| delete_cli-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / delete-cli-1.1.3.tar.gz
| Download URL | delete-cli-1.1.3.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e56ba1cdb5041ccaf3c551fa75cfe4206bdb30afa300100f8c7ace1e636af05
|
|
BLAKE2b-256 checksum How to use checksums |
baebc15007b0a9109e729e46456fbabf4d59f7fd581083da34f8859932f67046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|
Release files / delete_cli-1.1.3-py3-none-any.whl
| Download URL | delete_cli-1.1.3-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
504d6bb0f64c7ea4db0a9ba71dc78b110773c0327601705b40ec91a5c1bc9116
|
|
BLAKE2b-256 checksum How to use checksums |
b167d1777a6c4e7bbbd1d8365f3b715403f484c346749cfa942232e62f413be6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|