Skip to content

arithmeticmean/safe-remove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

srm - Safe Remove CLI

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.


πŸš€ Features

  • Mimics rm command 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.


πŸ“¦ Installation

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.git

πŸ“‚ Trash Specification

srm 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.)

πŸ“… Roadmap

  • Basic flag support (-r, -d)

  • Full GNU rm compatibility

  • Cross-platform support (macOS, Windows WSL)

  • Restore functionality (srm-restore)

  • Configurable trash directory


⚠️ Disclaimer

srm is still in early development. Always double-check before removing important files. While it uses Trash instead of deletion, bugs can happen!


πŸ“„ License

MIT License. See LICENSE for details.


About

A secure safe trash based alternative to rm for file deletion.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages