Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ansilithic/rm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

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

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

About

Safe rm for macOS — moves files to Trash instead of permanent deletion. Drop-in Swift replacement for /bin/rm.

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /