_______ _______ _______ _______ ______ __ __ | || _ || || | | _ | | |_| | | _____|| |_| || ___|| ___| ____ | | || | | | |_____ | || |___ | |___ |____| | |_||_ | | |_____ || || ___|| ___| | __ || | _____| || _ || | | |___ | | | || ||_|| | |_______||__| |__||___| |_______| |___| |_||_| |_|
A much safer replacement of bash
rm with ALMOST FULL features of the origin
Initially developed on Mac OS X, then tested on Linux.
safe-rm, the files or directories you choose to remove will move to
$HOME/.Trash instead of simply deleting them. You could put them back whenever you want manually.
If a file or directory with the same name already exists in the Trash, the name of newly-deleted items will be ended with the current date and time.
For those implemented options, safe-rm will act exactly the same as the original
Combined short options are also supported, such as
Add an alias to your
/path/to is where you git clone
shell-safe-rm in your local machine.
If you have NPM (node) installed (RECOMMENDED):
npm i -g safe-rm
Or normally with
make && sudo make install # and enjoy
For those who have no
sudo sh install.sh
Installing safe-rm will put
safe-rm in your
/bin directory. In order to use
safe-rm, you need to add an alias to your
~/.bashrc script and in all yours
currently open terminals, like this:
After installation and alias definition, when you execute
rm command in the Terminal, lines of below will be printed:
> rm safe-rm usage: rm [-f | -i] [-dPRrvW] file ... unlink file
which helps to tell safe-rm from the original rm.
First remove the
alias line from your
~/.bashrc file, then
npm uninstall -g safe-rm
make && sudo make uninstall
sudo sh uninstall.sh