trash
TLDR
Send a file to the trash
SYNOPSIS
trash [options] file...
trash-list
trash-restore
trash-empty [days]
trash-rm pattern
DESCRIPTION
trash-cli is a command-line interface to the FreeDesktop.org Trash specification, providing a safer alternative to rm by moving files to a recoverable trash location instead of permanent deletion. The trash follows XDG standards and integrates with desktop file managers.
Files can be restored to their original location using trash-restore, which presents an interactive menu of trashed items. The trash-empty command permanently deletes items from the trash, with optional age filtering.
PARAMETERS
trash files
Move files to trash (alias: trash-put)trash-list
List files in trash with original path and deletion datetrash-restore
Interactively restore files from trashtrash-empty [days]
Empty trash, optionally only files older than daystrash-rm pattern
Remove files from trash matching pattern or original path-d, --directory
Remove empty directories-f, --force
Ignore nonexistent files-v, --verbose
Explain what is being done--trash-dir dir
Use specified trash directory
CAVEATS
Trashing files on external drives creates a .Trash directory on that drive. Disk space is not freed until trash is emptied. Files trashed from command line may not appear in desktop trash depending on file manager implementation.
HISTORY
Developed by Andrea Francia as a command-line implementation of the FreeDesktop.org Trash specification. Provides Unix philosophy-compliant access to desktop trash functionality, enabling safe deletion practices in terminal workflows.


