trash-cli is a command line interface to the freedesktop.org trashcan that lets you safely delete files from the terminal while preserving recovery options.
The tool solves the problem of permanent data loss when using rm from scripts or the command line. Instead of immediately deleting files, trash-cli moves them to the system trashcan used by KDE, GNOME, and XFCE, recording the original path, deletion date, and file permissions. This approach integrates with the desktop environment's trash mechanism rather than creating a separate deletion system, so files deleted via trash-cli appear in the same recovery interface as files deleted through graphical file managers.
The tool suits developers and system administrators who want safer deletion semantics in shell scripts and interactive terminal sessions. It is particularly valuable for those who frequently work with command-line tools but want the safety net of a recoverable trash rather than permanent deletion. The project provides five core commands: trash-put to delete files, trash-list to view trashed items with timestamps and original paths, trash-restore to recover files with interactive selection, trash-empty to permanently purge the trash with optional age-based filtering, and trash-rm to remove specific files from the trash. The restore command supports batch recovery of multiple files using range notation and can overwrite existing files during restoration.
The project maintains a stable, long-running codebase with infrequent but deliberate updates focused on bug fixes and compatibility improvements rather than feature expansion. Development activity shows careful attention to edge cases and user-reported issues, with changes typically addressing specific problems in trash handling across different Linux distributions and desktop environments. The tool has established itself as a mature utility with straightforward maintenance patterns and a clear scope that has remained consistent over time.