Skip to main content

A simple, cross-platform, 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 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.

Project details


Download files

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

Source Distribution

delete_cli-2.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

delete_cli-2.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file delete_cli-2.0.0.tar.gz.

File metadata

  • Download URL: delete_cli-2.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for delete_cli-2.0.0.tar.gz
Algorithm Hash digest
SHA256 774ae6cf546846285b13a5f78320e73dba782b1b35e1d992572a4b686da4ed53
MD5 eaf5018a5ca60ca99b00013be6afadc2
BLAKE2b-256 ad3113da80953801d185806ddb3a0e0dff3ecc5cafd1aa9f77e7af2da6a84ff7

See more details on using hashes here.

File details

Details for the file delete_cli-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: delete_cli-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for delete_cli-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68466bfc34e889693f97103b37836d925051993ea47e6a643f34f4eb3960b298
MD5 c5f5a74245b281600fcc5148bd71a857
BLAKE2b-256 52b96d48ebe201a73585585734e68e5df498044c219fb751bf7f15a5d5f2289c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page