safe-rm
« Back to VersTracker
Description:
Wraps rm to prevent dangerous deletion of files
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: System utilities
Tags: cli safety utility file-management system
Install: brew install safe-rm
About:
SafeRm is a wrapper for the standard rm command that adds a layer of protection against accidental deletion of important files. It works by checking paths against a user-defined blacklist of protected directories like /, /usr, or /etc before allowing removal. If a protected path is targeted, the command is blocked, preventing catastrophic data loss.
Key Features:
  • Protects critical system directories from accidental deletion
  • User-configurable blacklist of protected paths
  • Acts as a drop-in replacement for the standard rm command
  • Provides clear error messages when blocking a deletion
Use Cases:
  • Preventing catastrophic system damage from a mistyped rm command
  • Protecting critical project directories on a development machine
  • Adding a safety net for users who frequently use the command line
Alternatives:
  • trash-cli – Moves files to a trash can for recovery, whereas safe-rm simply blocks deletion.
  • rm -i – Prompts for every single file confirmation, which can be tedious; safe-rm automates protection for specific paths.
Version History
Detected Version Rev Change Commit
Sep 14, 2024 4:13pm 0 VERSION_BUMP e5d2e832