Swift 6.0 macOS 14+ License: MIT
Drop-in rm replacement for macOS that moves files to Trash instead of permanently deleting them.
rm delegates to /usr/bin/trash so every deletion is recoverable from the macOS Trash. It accepts the same arguments as /bin/rm — files go to Trash silently on success, with errors printed to stderr on failure.
Supports -f (suppress errors for missing files) and -- (end of options for filenames starting with -). All other flags are accepted and ignored — files always go to Trash regardless.
Build from source (requires Xcode and macOS 14+):
make build && make installEnsure /usr/local/bin appears before /bin in $PATH to shadow the system rm.
rm [-f] [--] file ...
# Move files to Trash rm file.txt rm *.log # Silently skip missing files rm -f maybe-exists.txt # Handle filenames starting with - rm -- -weird-name.txt
MIT