rip

A safe, ergonomic alternative to rm that sends files to a graveyard instead of permanently deleting them — with one-step undo.

rip (rm-improved) is a safe alternative to the Unix rm command. Instead of immediately and permanently deleting files, rip sends them to a graveyard directory (by default $XDG_DATA_HOME/graveyard), where they can be inspected and restored. Accidental deletions become trivially recoverable.

Features

  • Soft deletes — files go to a graveyard, not into the void; recover them any time with rip -u
  • One-step undorip -u restores the most recently deleted file or directory to its original location
  • Graveyard inspectionrip -s shows a list of everything currently in the graveyard
  • Sexton mode — permanently delete the graveyard contents when you're sure with rip --sexton
  • Symlink preservation — handles symlinks correctly, unlike some rm alternatives
  • Cross-filesystem — moves files between filesystems when necessary rather than failing silently
  • Interactive undelete — pipe rip -s output through fzf to interactively select which file to restore

Installation

cargo install rm-improved

Note: the crate is named rm-improved but the binary is rip.

Or via your package manager:

# Debian / Fedora
# Pre-built Linux binaries (.deb and .rpm) are available on the
# [releases page](https://github.com/nivekuil/rip/releases).

# Arch Linux
pacman -S rm-improved

# macOS
brew install rip

Usage

# Delete a file (sends to graveyard)
rip file.txt

# Delete multiple files
rip file1.txt file2.txt dir/

# Undo the last deletion (restore to original location)
rip -u

# Show what's currently in the graveyard
rip -s

# Permanently delete everything in the graveyard
rip --sexton

# Inspect the graveyard directory directly
ls $XDG_DATA_HOME/graveyard

Interactive restore with fzf

Combine rip -s with fzf to interactively browse and restore files:

rip -s | fzf | xargs rip -u

Tip: alias rm

Add this to your shell config to use rip everywhere:

alias rm='rip'

Because rip is argument-compatible with common rm usage, this alias is safe for everyday use. Unlike rm, muscle memory mistakes are now recoverable.

Graveyard location

By default the graveyard lives at $XDG_DATA_HOME/graveyard (usually ~/.local/share/graveyard). Override it with the GRAVEYARD environment variable:

export GRAVEYARD=/tmp/graveyard

Using a graveyard on the same filesystem as your home directory means deletions are instant (a rename, not a copy). Using a separate partition or /tmp means files are copied on delete.