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,--permaoptions - Works with
sudofor 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, use sudo -E resrm, or add the $PATH to /etc/sudoers using its Defaults secure_path parameter.
Install via PyPI:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file resrm-0.1.1.tar.gz.
File metadata
- Download URL: resrm-0.1.1.tar.gz
- Upload date:
- Size: 16.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f4f1e221c72578937ea8f940c99522f94c3fa4e4a85a7067fcf374dac58a63f
|
|
| MD5 |
7bc8a75422e9449e6bd292854d81a4fe
|
|
| BLAKE2b-256 |
cf49d4ed94d532e4617c6a851913fca3dadce0247d0e1f2765dab98bfe0c9ea1
|
File details
Details for the file resrm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: resrm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4d926fb6c762f19e56063c679a71b2ca47ebf29b604490b9ef1dbefdaa228a2
|
|
| MD5 |
6b266d85ae3d9029cc23f02a5b36a42d
|
|
| BLAKE2b-256 |
509a9f8f63f145d513a90b7832947a50ca6ed0650b2dc4560a3444d26dfe60a6
|