Skip to main content

Delete

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

License PyPI Version Python Versions Documentation Downloads

But why?

The del 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.

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

Installation

If you already have Python 3.12+ on your system, you can install del using Pip.

pip install delete-cli

Basic Usage

Calling del 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 del.

Deleting files and folders is as simple as:

del 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: del --help. For a more comprehensive usage guide on the command line you can view the manual page with man del.

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 2.0.0

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 2.0.0
File Size Uploaded
delete_cli-2.0.0.tar.gz 6.7 kB Details

Built distribution (wheel)

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

Total release size: 14.2 kB

Release files / delete_cli-2.0.0.tar.gz

Download URL delete_cli-2.0.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
774ae6cf546846285b13a5f78320e73dba782b1b35e1d992572a4b686da4ed53
BLAKE2b-256 checksum
How to use checksums
ad3113da80953801d185806ddb3a0e0dff3ecc5cafd1aa9f77e7af2da6a84ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

Release files / delete_cli-2.0.0-py3-none-any.whl

Download URL delete_cli-2.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68466bfc34e889693f97103b37836d925051993ea47e6a643f34f4eb3960b298
BLAKE2b-256 checksum
How to use checksums
52b96d48ebe201a73585585734e68e5df498044c219fb751bf7f15a5d5f2289c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

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