rip
=rip= is a command-line deletion tool focused on safety, ergonomics, and performance.
Automatically checked · GitHub checked 2026-11-17

Overview
=rip= is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does /not/ implement the xdg-trash spec or attempt to achieve the same goals. Deleted files get sent to the graveyard (=/tmp/graveyard-$USER= by default, see [https://github.com/nivekuil/rip#-notes] on changing this) under their absolute path, giving you a chance to recover them. No data is overwritten. If files that share the same path are deleted, they will be renamed as numbered backups. OPTIONS: --graveyard Directory where deleted files go to rest -u, --unbury Undo the last removal by the current user, or specify some file(s) in the graveyard. Combine with -s to restore everything printed by -s. ARGS: ... File or directory to remove #+END_EXAMPLE Basic usage -- easier than rm #+BEGIN_EXAMPLE $ rip dir1/ file1 #+END_EXAMPLE Undo the last deletion #+BEGIN_EXAMPLE $ rip -u Returned /tmp/graveyard-jack/home/jack/file1 to /home/jack/file1 #+END_EXAMPLE Print some info (size and first few lines in a file, total size and first few files in a directory) about the target and then prompt for deletion #+BEGIN_EXAMPLE $ rip -i file1 dir1: file, 1337 bytes including: > Position: Shooting Guard and Small Forward ▪ Shoots: Right > 6-6, 185lb (198cm, 83kg) Send file1 to the graveyard? (y/n) y #+END_EXAMPLE Print files that were deleted from under the current directory #+BEGIN_EXAMPLE $ rip -s /tmp/graveyard-jack/home/jack/file1 /tmp/graveyard-jack/home/jack/dir1 #+END_EXAMPLE Name conflicts are resolved #+BEGIN_EXAMPLE $ touch file1 $ rip file1 $ rip -s /tmp/graveyard-jack/home/jack/dir1 /tmp/graveyard-jack/home/jack/file1 /tmp/graveyard-jack/home/jack/file1~1 #+END_EXAMPLE -u also takes the path of a file in the graveyard #+BEGIN_EXAMPLE $ rip -u /tmp/graveyard-jack/home/jack/file1 Returned /tmp/graveyard-jack/home/jack/file1 to /home/jack/file1 #+END_EXAMPLE Combine -u and -s to restore everything printed by -s #+BEGIN_EXAMPLE $ rip -su Returned /tmp/graveyard-jack/home/jack/dir1 to /home/jack/dir1 Returned /tmp/graveyard-jack/home/jack/file1~1 to /home/jack/file1~1 #+END_EXAMPLE Emacs #+begin_src emacs-lisp (setq delete-by-moving-to-trash t) (defun system-move-file-to-trash (filename) (shell-command (concat (executable-find "rip") " " filename))) #+end_src