Documentation

rm-trash – rm wrapper with trash recovery

rm-trash is a command-line wrapper designed to provide recoverable deletion while accepting familiar rm arguments. It saves removed files and directories in the desktop trash so that they can be restored if they are needed again.

Unlike utilities that simply rename files into an independent recovery directory, rm-trash attempts to preserve the behaviour and diagnostic messages of the standard rm command. It can process recursive deletion requests, deal with duplicate names in the trash and handle certain permission-related problems.

The application first processes the requested deletion and saves the relevant files and metadata in the trash. The original removal is then performed using the underlying rm command. This approach aims to combine rm compatibility with the ability to recover discarded data.

The wrapper also provides a way to bypass trash handling when permanent deletion is explicitly required.

This is free and open source software.

Key Features

  • Save files in the trash before completing an rm-style deletion.
  • Accept arguments intended for the standard rm command.
  • Support recursive file and directory removal.
  • Handle files with names that already exist in the trash.
  • Preserve metadata needed for restoring discarded items.
  • Attempt to handle certain permission-related deletion problems.
  • Pass removal operations through the underlying rm command.
  • Display error messages corresponding to rm failures.
  • Remove unnecessary trash copies when the underlying deletion fails.
  • Use the underlying rm command when invoked indirectly from scripts.
  • Allow permanent deletion without saving a trash copy using –no-trash.
  • Support use as a shell alias for familiar removal commands.

Website: github.com/nateshmbhat/rm-trash
Support:
Developer: Natesh M Bhat
License: MIT License

rm-trash is written in Bash. Learn Bash with our recommended free books and free tutorials.

Alternatives to rm


Explore Linux

Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category.
In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality.

The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions.
Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others.
Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems.
Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks.
Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems.
Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux.
Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools.
Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux.
Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted