An "rm" alias / wrapper via "trash-cli"
200 Words | Approximately 1 Minutes Read | Last Modified on August 12, 2014
The trash-cli
package is a nice rm
alternative that prevents rm
tragedies by moving file to trash (~/.local/share/Trash/files
) instead of deleting it. This bash script is a wrapper for its “trash-put” command that mimics the exact behavior of rm
such that -r/-R
argument is required to delete a directory. Use -f
for the actual rm
.
Latest Version
Usage
- Install
trash-cli
package. In Debian 7 (also Ubuntu 12) it is available viaapt-get
. - Download the script, make it executable, put it to some
$PATH
folder (e.g./usr/local/bin
) such that it gets loaded prior to the actualrm
located in/bin
- Alternatively you can use shell alias