Skip to main content

A simple command line move-to-trash.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for delete-cli, version 1.1.4
Filename, size File type Python version Upload date Hashes
Filename, size delete_cli-1.1.4-py3-none-any.whl (14.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size delete-cli-1.1.4.tar.gz (9.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page