A safer rm replacement for macOS that moves files to Trash.
Project description
trasher
trash is a small rm-like CLI that moves files/directories into the macOS Trash instead of deleting them.
Install (dev / editable)
python3 -m pip install -e .
If your trash executable isn’t found after installing, make sure your Python “scripts” directory is on PATH
(for the python.org installer this is often /Library/Frameworks/Python.framework/Versions/<ver>/bin).
Usage
trash some-file.txt
trash -r some-directory/
trash -rf build/ dist/
trash -i important.txt
trash --dry-run -rv *
If trash is already taken on your system, use trasher (installed by this project) or adjust your PATH so this project’s trash resolves first.
Notes
- By default, items are moved into the appropriate macOS Trash folder:
- Same volume as your home:
~/.Trash - Other volumes:
<volume>/.Trashes/<uid>/
- Same volume as your home:
- When run via
sudo, the tool uses the invoking user’s Trash (viaSUDO_UID/SUDO_USER) when available. - If
sudo trash ...can’t find the executable, usesudo $(which trash) ...or add the install location tosudo’ssecure_path. - This tool moves items to Trash for recovery, but Finder “Put Back” metadata is not guaranteed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trasher-0.1.0.tar.gz.
File metadata
- Download URL: trasher-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bca5a8151dc3e415bed2f029bf6ba709286592f28c78bafc544a7f6ed14ed97
|
|
| MD5 |
1bde08f8934f96e53ea59be3fbbdc20a
|
|
| BLAKE2b-256 |
64ba7444e0f9a8b615af05dc701466b5ef5eb0a2ec179da91cded87b49f921e6
|
File details
Details for the file trasher-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trasher-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f9d3dd67d933a97e890058ec04149f550f9cec47c4f5de58e18619f4d8ba169
|
|
| MD5 |
5890595f190c69ef51cead26adccdd66
|
|
| BLAKE2b-256 |
dece67e2827f76b49ce9b8cd8c8058f33588b359f847e44c6fef777a4e2b47bd
|