Skip to content

frroossst/rmsafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rmsafe (remove_safely)

Introduction

After (almost) accidentally removing a file with about week's worth of changes for my C lang assignment, I took it as an excuse to lear a bit more of Rust and re-write the rm command.

Basics

Instead of just rm(ing) files and folders, they instead are moved to the local trash or custom path location.

Installation

cargo install rmsafe

Usage

// view help 
rms

// removing a single file
rmsafe test.txt

// removing a single folder; it will recursively move the folder to trash
rmsafe test_dir

// removing files with wildcard matching; removing all files ending with .o
// the shell is supposed to handle the glob expansion not the program
rmsafe -r *.o


Change your .bashrc to include the following

alias rm='printf "Avoid using rm!"'

This disallows the use of rm, you can still use sudo rm and not setting rmsafe to rm ensures that you don't accidentally rm while on someone else's computer

Contribution

Open up an issue on GitHub and I'll be in touch!

About

Rust powered cli utility to mv files and directories to trashcan rather than rm(ing) them

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages