Trash CLI Cheatsheet
Install
On Ubuntu 22.04, it was as easy as running:
sudo apt update && apt install trash-cli
Cheats
List Trashed Files
trash-list
Move Files To Trash
Move Specific File To Trash
trash-put file1
Restore Trashed Files
If you want to restore a file from trash, run:
trash-restore
This will give you an indexed list of files. Press the number corresponding to the file you wish to restore and it will restore it to its original location.
Empty Trash
Remove Files Trashed More Than X Days
trash-empty $NUM_DAYS
Remove All Trashed Files
trash-empty
References
- Tecmint - Trash-cli – A Trashcan Tool to Manage ‘Trash’ from Linux Command Line
- Dev.to - Command Line Recycle-Bin For Linux System
Last updated: 22nd October 2023
First published: 22nd October 2023
First published: 22nd October 2023