Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.21 KB

File metadata and controls

51 lines (33 loc) · 1.21 KB

rm

Swift 6.0 macOS 14+ License: MIT

Drop-in rm replacement for macOS that moves files to Trash instead of permanently deleting them.

How it works

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.

Install

brew install ansilithic/tap/rm

Or build from source (requires Xcode and macOS 14+):

make build && make install

Ensure /usr/local/bin appears before /bin in $PATH to shadow the system rm.

Usage

rm [-f] [--] file ...

Examples

# 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

License

MIT