Method 1 – rm alias to mv to Trash

# in your aliases – e.g. ~/.bash_aliases – add this line

Method 2 – using trash-cli

trash-cli, in Python
trash-cli: (Open Source) Command line interface to the Linux trash can. Interoperates with all the desktop trash cans (KDE/Gnome/Xfce). Included in some Linux distributions. Proudly written in Python.
Written by italian developer Andrea Francia

# in your aliases – e.g. ~/.bash_aliases – add this line

trash-put trashes files and directories.
trash-empty empty the trashcan(s).
trash-list list trashed file.
restore-trash restore a trashed file.
trash-rm remove individual files from trash can.


About Gugulethu Ncube

IT enthusiast getting things done.