🗑 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
Built Distribution
File details
Details for the file rm_trash-0.0.2.tar.gz
.
File metadata
- Download URL: rm_trash-0.0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed106c8eea7e20ea0704d5b9cee5e776aa4375d58e5481b27bf09b52816b3dde |
|
MD5 | efe82e5be0090f40f7d0bae393012e6c |
|
BLAKE2b-256 | dfebceec24f007ce8de9e76983c70bd9ede1996a86e3e6df9e096e7833c5d238 |
File details
Details for the file rm_trash-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: rm_trash-0.0.2-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e340a9fba6e6d2ae26ff3051c958d6a9cb0fd179ddf9e786d4fa5b70d56e49ed |
|
MD5 | d0b4cd0434375abc237144c8f1165ea5 |
|
BLAKE2b-256 | 606613319507e9fa7d00d9305179277e9e1dd8e091f391e4f0278b4049446083 |