srm is a safer alternative to the classic Unix rm command. Instead of permanently deleting files, srm moves them to the system Trash, following the FreeDesktop.org Trash Specification.
This allows users to recover accidentally "removed" files, making srm a more forgiving and user-friendly replacement for rm.
- Mimics
rmcommand behavior for easier adoption. - Supports commonly used flags:
-r: Recursively remove directories-d: Remove empty directories
- Complies with the FreeDesktop Trash Specification
- Files are not deleted, just moved to the system Trash.
β Future goal: Full compatibility with GNU
rm, including all its flags and behavior nuances.
Coming soon: Pre-built binaries and package manager instructions.
For now, clone and build from source:
cargo install --git https://github.com/arithmeticmean/safe-remove.gitsrm follows the FreeDesktop Trash Specification, ensuring compatibility with desktop environments and standard trash-handling tools.
Deleted files are stored in:
~/.local/share/Trash/files/ β for file data
~/.local/share/Trash/info/ β for metadata (original path, deletion time, etc.)
-
Basic flag support (-r, -d)
-
Full GNU
rmcompatibility -
Cross-platform support (macOS, Windows WSL)
-
Restore functionality (srm-restore)
-
Configurable trash directory
srm is still in early development. Always double-check before removing important files. While it uses Trash instead of deletion, bugs can happen!
MIT License. See LICENSE for details.