Skip to main content

🗑 Safe(r) deletion of files from the macOS command line

Project description

rm-trash

rm-trash is a macOS command-line utility that moves files and directories to the Trash. Unlike similar tools, rm-trash intends to be a complete alternative to rm and rmdir, to the extent that you could use aliases to have rm-trash replace them both.

rm-trash works by communicating with Finder through AppleScript, so it's no different from moving files to the Trash from within Finder itself.

Installation

Install rm-trash with Homebrew via the Houkago Tea Tap.

brew tap celsiusnarhwal/htt
brew install rm-trash

Usage

Invoke rm-trash with the trash command, which will become available after installation.

trash --help

will tell you everything you need to know.

Replacing rm and rmdir

If you wish, you can replace rm and rmdir with aliases to trash.

alias rm="trash trash"
alias rmdir="trash dir"

trash supports all options of both commands. Run trash --help for details.

Limitations

rm-trash refuses to as root when System Integrity Protection (SIP) is disabled. You can still run rm-trash as a non-root user when SIP is disabled, or as any user when SIP is enabled. This limitation is intended to prevent you from accidentally trashing files and directories that are typically protected by SIP.

If you must remove files as root while SIP is disabled, you can always fall back to rm.

License

rm-trash is licensed under the MIT License.

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

rm_trash-0.0.5.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

rm_trash-0.0.5-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file rm_trash-0.0.5.tar.gz.

File metadata

  • Download URL: rm_trash-0.0.5.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.0 Linux/5.15.0-1024-azure

File hashes

Hashes for rm_trash-0.0.5.tar.gz
Algorithm Hash digest
SHA256 238e1a324b21ccbd632f381134d5b5d79ee7a83376610aefd6ccba3c3ad38666
MD5 4d97e8a291e8bb7ff4daf50d2ab474cf
BLAKE2b-256 66290e0608f2634eeaa9f3528d2a445cc09c9fbd5727c20fdc90b4cd5e73806c

See more details on using hashes here.

File details

Details for the file rm_trash-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: rm_trash-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.0 Linux/5.15.0-1024-azure

File hashes

Hashes for rm_trash-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb468d6bbf8ae67d7066a8bbb348b73c94ebd9be082781d412129bb75dc768d2
MD5 4f9289cb674b152802d11405840a8761
BLAKE2b-256 e7c50d1f270e0269021243fc527599ad8fce8e1f9af0e269478f92d4b39ddbc2

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