#trash #rm #file-deletion #replace #permanent #shell-integration

app rmxt

A replacement for the 'rm' command with a trash feature for safer file deletion

15 releases

Uses new Rust 2024

0.1.14 Oct 6, 2025
0.1.13 Sep 18, 2025
0.1.7 Aug 31, 2025

#1195 in Command line utilities

Download history 285/week @ 2025-08-22 409/week @ 2025-08-29 359/week @ 2025-09-05 133/week @ 2025-09-12 96/week @ 2025-09-19 17/week @ 2025-09-26 112/week @ 2025-10-03 24/week @ 2025-10-10 6/week @ 2025-10-17 3/week @ 2025-10-24

152 downloads per month

MIT license

32KB
617 lines

rmxt

A safer, recoverable alternative to the traditional rm command that moves files to the system trash instead of permanently deleting them.

Features

  • File recovery - Restore individual files, files from specific day to now or all files from trash
  • Trash management - List, purge, and automatically clean old files
  • Shell integration - Drop-in replacement for rm command
  • Safety first - Prevents accidental permanent deletion
  • Flexible options - Force, recursive, and bypass modes available
  • Enhanced output - Colored error messages and formatted table display for trash listings
  • Time-based operations - Filter and manage files based on deletion timestamps
  • Name conflict resolution - Automatically appends the current date and time as a suffix if a file with the same name already exists in the trash

Documentation

For comprehensive guides and detailed examples, see our modular documentation:

Quick Start

The fastest way to install rmxt:

curl -fsSL https://raw.githubusercontent.com/santoshxshrestha/rmxt/main/scripts/install.sh | bash

Basic Installation

cargo install rmxt

Nix Flake (for Nix users)

If you use Nix, you can run or build rmxt without installing Rust:

nix run github:santoshxshrestha/rmxt

Or build the binary:

nix build github:santoshxshrestha/rmxt

See the Installation Guide for full details and prerequisites.

For detailed installation instructions including platform-specific setup, see the Installation Guide.

Basic Usage

# Remove files safely (move to trash)
rmxt file.txt directory/

# List files in trash
rmxt list

# Recover files from trash
rmxt recover file.txt
rmxt recover-all

# Clean old files from trash
rmxt tidy

For comprehensive usage examples, workflows, and advanced operations, see the Usage Guide.

Shell Integration

Replace rm with rmxt for safer file operations:

# Add to ~/.bashrc or ~/.zshrc
alias rm='rmxt'

For complete shell integration including advanced configurations, tab completion, and cross-shell compatibility, see the Advanced Features Guide.

Command Reference (Quick Reference)

Flags

Flag Long Form Description
-p --permanent Permanently delete without using trash
-r --recursive Remove directories and contents recursively
-f --force Force removal without prompts
-d --dir Remove empty directories
-t --time Specify days for recovery or tidy commands

Commands

Command Description
list [-t days] Show files in trash with optional time filter
recover <name> Restore specific file from trash
recover-all Restore all files from trash
purge <name> Permanently delete specific file from trash
tidy [-t days] Remove old files from trash (default: 30 days)

⚠️ Warning: The -p, --permanent flag permanently deletes files without moving them to trash. Use with caution!

Advanced Features

For power users and complex workflows:

Troubleshooting

Having issues? Check the Advanced Features Guide for solutions to common problems:

  • Installation and compilation issues
  • Permission and access problems
  • Recovery and trash system issues

Cross-Platform Support

rmxt integrates with native system trash implementations across platforms:

  • Linux: ~/.local/share/Trash/files/ (XDG specification)
  • macOS: ~/.Trash/ (Finder integration)
  • Windows: Recycle Bin (native integration)

The exact location is managed by the system's trash implementation, ensuring compatibility with your desktop environment.

Development & Contributing

How to Contribute

We welcome contributions! Here's how you can help:

  1. Report Issues: Found a bug or have a feature request? Open an issue
  2. Submit Pull Requests: Fix bugs or add features with a pull request
  3. Improve Documentation: Help expand or clarify the documentation
  4. Share Feedback: Let us know how you use rmxt and what could be better

Development Setup

# Clone the repository
git clone https://github.com/santoshxshrestha/rmxt
cd rmxt

# Build and test
cargo build
cargo test

# Install locally for testing
cargo install --path .

Planned Improvements

  • Enhanced configuration options for trash behavior
  • Performance optimizations for large directories

For technical details and advanced development topics, see the documentation guides.

License

This project is licensed under the MIT License.

Repository

Dependencies

~5–34MB
~438K SLoC