A simple, safe, and scriptable command-line trash manager for Linux. Instead of deleting files permanently with rm, use trash-cli to move them to a recoverable trash bin — just like your desktop environment.
- Safely "delete" files or directories by moving them to a trash bin
- Restore trashed files to their original location
- List all trashed files with deletion timestamps
- Permanently empty the trash
- Fully terminal-based with no external dependencies
~/.local/share/trash-cli
├── files/ # Trashed files/folders
└── info/ # Metadata (original path, deletion time) -
Clone the Repo or Download project
-
Copy the script
Copy
trash-cli.shfile to/usr/local/bin/cp trash-cli.sh /usr/local/bin/trash-cli
-
Make it Executable
sudo chmod +x /usr/local/bin/trash-cli
trash-cli put myfile.txt folder/trash-cli listExample Output:
myfile.txt_20250605181230 -> /home/user/myfile.txt (Deleted at: Wed Jun 5 18:12:30 2025)trash-cli restore myfile.txt_20250605181230Restores to the original directory (if it still exists).
trash-cli empty