Skip to main content

A simple, cross-platform, command line move-to-trash.

License PyPI Version Python Versions Documentation Downloads

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for delete-cli 1.1.2
File Size Uploaded
delete-cli-1.1.2.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for delete-cli 1.1.2
File Interpreter ABI Platform
delete_cli-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.3 kB

Release files / delete-cli-1.1.2.tar.gz

Download URL delete-cli-1.1.2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5e877be3e722703aefa18083df9ddb89a7c6264a2acecfc3038250c738cb9ccf
BLAKE2b-256 checksum
How to use checksums
f20168a2b546647df9b942b245f76ab4b485e45f1e7a7742c4ea9eee39dc47d4
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.2-py3-none-any.whl

Download URL delete_cli-1.1.2-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80a834845f3b96c688352423912b89f892e6db454637d4b70f25fbf81c820e15
BLAKE2b-256 checksum
How to use checksums
9a12fe4b1d4acd49bb3fffbb7d004a9b3b44477041ca5eb90e39725a40f01e3b
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 history Release notifications | RSS feed

2.0.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page