MCPcopy Index your code
hub / github.com/demfabris/rmx

github.com/demfabris/rmx @v0.1.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.6 ↗ · + Follow
105 symbols 231 edges 15 files 53 documented · 50%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rmx

Crates.io Crates.io Crates.io

Multiplatform drop in replacement for GNU rm with extra features

About

This project is a close port of GNU rm. The idea is extending the functionality around rm API and bring some niceties with improved performance, specially for large files and deeply nested directories.

Features

  • [x] :penguin: Original GNU rm api
  • [x] :paperclip: System trash bin integration (-t)
  • [x] :zap: Blazingly fast
  • [x] :skull: Unrecoverable removal (--shred)
  • [ ] :mag_right: More filtering options

Benchmarks

Benches are defined here

Running

To profile how rmx performs on your system:

cargo bench

Comparison

remove rmx rm rmt rmd
files 4.9297ms 19.991ms 10.003ms 9.2056ms
recursively nested folders 4.9784ms 20.122ms 10.135ms 9.3328ms
multiple deeply nested folders 4.8809ms 19.504ms 10.308ms 9.2406ms
multiple deeply nested folders (rip mode) 4.2580ms - - -

numbers obtained on a Alienware M15 R6, at commit: 34e1e5a2

rmx consistently scores better performance while offering the same API as GNU rm

Examples

Deleting deeply nested directory (blazingly fast)

rmx --rip node_modules

Sending files to system trash bin

rmx file1 file2 -t

Follow symlinks (unix only)

rmx --follow-links link

Wipe a file and make it unrecoverable

rmx --shred file

Standard GNU rm usage

  • rmx --one-file-system -i *.txt handles more glob matching args, rm panics at ~10k+ matches`
  • rmx --preserve-root=/home --interactive=once /home/*/*
  • rmx --verbose -rf --no-preserve-root /

Installation

Source

From crates.io

cargo install rmx

Binaries

AUR: yay rmx-bin

Prebuilt binaries

Find all release targets here

Latest linux-musl binary

Pro-tip:

Put in your favorite shell rc file: alias rm='rmx'

Disclaimer

  1. Do not trust this tool for automation/production usage, this is not a 1:1 port of GNU rm and the underlying system calls are not the same.
  2. You may experience different performance results, overall rmx improves the computation load. I/O might still be your biggest bottleneck.
  3. Making the contents of a file unrecoverable is not a fully trusted operation nowadays.

Core symbols most depended-on inside this repo

no_interactive_bin
called by 41
tests/dir.rs
installed
called by 12
benches/cli.rs
no_interactive_bin
called by 9
tests/file.rs
m_nested_folder_n
called by 8
benches/cli.rs
concat_relative_root
called by 7
src/core.rs
with_message
called by 6
src/interact.rs
run
called by 6
src/shred.rs
remove_file
called by 6
tests/file.rs

Shape

Function 92
Method 7
Enum 4
Class 2

Languages

Rust100%

Modules by API surface

tests/dir.rs42 symbols
benches/cli.rs12 symbols
src/core.rs11 symbols
tests/file.rs10 symbols
src/shred.rs7 symbols
src/arg.rs6 symbols
tests/shred.rs4 symbols
tests/links.rs3 symbols
src/traverse.rs2 symbols
src/main.rs2 symbols
src/error.rs2 symbols
src/link.rs1 symbols

For agents

$ claude mcp add rmx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact