Skip to main content

drop-in replacement for rm with undo/restore built-in.

Project description

resrm

resrm is a safe, drop-in replacement for the Linux rm command with undo/restore support.
It moves files to a per-user trash instead of permanently deleting them, while still allowing full sudo support for root-owned files.


Features

  • Move files and directories to a trash folder instead of permanent deletion
  • Restore deleted files by short ID or exact basename
  • Empty trash safely
  • Supports -r, -f, -i, --perma options
  • Works with sudo for root-owned files

Installation

NOTE: To use resrm with sudo, the path to resrm must be in the $PATH seen by root.
Either install resrm as root (preferred), use sudo -E resrm, or add the $PATH to /etc/sudoers using its Defaults secure_path parameter.

Install via PyPI (preferred):

pip install resrm

Or clone the repo and install locally:

git clone https://github.com/mdaleo404/resrm.git
cd resrm/resrm
poetry install

Usage

# Move files to trash
resrm file1 file2

# Recursive remove of a directory
resrm -r mydir

# Force remove (ignore nonexistent)
resrm -f file

# Interactive remove
resrm -i file

# Permanent delete (bypass trash)
resrm --perma file

# List trash entries
resrm -l

# Restore a file by ID or basename
resrm --restore <id|name>

# Empty the trash permanently
resrm --empty

Trash Location

Normal users: ~/.local/share/resrm/files

Root user: /root/.local/share/resrm/files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resrm-0.2.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resrm-0.2.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file resrm-0.2.0.tar.gz.

File metadata

  • Download URL: resrm-0.2.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.9 Linux/6.17.7-200.fc42.x86_64

File hashes

Hashes for resrm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 565c0dec0b56ec97527eee1fc66728f27e1bc81b61d6d8daf744a5eab3f09964
MD5 0e99da06a1eecddfc67ed733613a0a36
BLAKE2b-256 260e237817a0d92bba108db616cf2a2a8128e0d00215ff6c9e332100495e053c

See more details on using hashes here.

File details

Details for the file resrm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: resrm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.9 Linux/6.17.7-200.fc42.x86_64

File hashes

Hashes for resrm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f98d6fba33a4e1950bef45ca5a09684c1109d005095ed5d3f45e9289256c4f1
MD5 1dbac7918d764294cc2ffa159be57de2
BLAKE2b-256 0a0a3b0025c3583f75a88a573d77d3c9f5de2708f9c04299c462be6627002b54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page