Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Trash CLI Cheatsheet

Install

On Ubuntu 22.04, it was as easy as running:

sudo apt update && sudo 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

Last updated: 2nd December 2023
First published: 22nd October 2023