Iron Bin, a CLI for the Freedesktop trash written in Rust 🦀.
Iron Bin consists of a single command: trash.
To list the files in the trash:
trash listor
trash lsThe output is similar to that of the ls command, but the original paths are always absolute:
/home/johndoe/Documents/Invoice.pdf
/home/johndoe/Documents/Notes.doc
/home/johndoe/Downloads/funny.jpg
To display more details, add the -v option:
trash list -vThe output is similar to that of the ls -l command, but the columns are a bit different:
total 3
size deletion time original path
36196652 Mon Sep 8 22:11:09 2025 /home/johndoe/Documents/Invoice.pdf
4668381 Mon Sep 8 22:11:09 2025 /home/johndoe/Documents/Notes.doc
568731 Tue Sep 9 09:24:37 2025 /home/johndoe/Downloads/funny.jpg
Note: The same file may appear several times in the trash if it was put there at several different times.
To put a file in the trash:
trash put Downloads/message.txtTo prompt for confirmation before each file, add the -i option (similar to the rm -i command):
trash put -i Downloads/*To display a summary, add the -v option:
trash put Downloads/message.txttrashed /home/johndoe/Downloads/message.txt on Mon Nov 24 19:02:16 2025
total 1 trashed
To restore a file from the trash:
trash restore /home/johndoe/Documents/Notes.docYou can restore several files at once:
trash restore /home/johndoe/Documents/Notes.doc /home/johndoe/Downloads/funny.jpgNote: If the same file was put in the trash several times, the most recent version is restored.
To prompt for confirmation before each file, add the -i option (similar to the mv -i command):
trash restore -i /home/johndoe/Documents/Notes.docTo display a summary, add the -v option:
trash restore -v /home/johndoe/Documents/Notes.docrestored /home/johndoe/Documents/Notes.doc trashed on Mon Sep 8 22:11:09 2025
total 1 restored
To empty the trash:
trash emptyA confirmation prompt is displayed.
To skip it, add the -f option:
trash empty -f- Only the home trash is supported
- Only UTF-8 file names are supported
See CHANGELOG.
Iron Bin is licensed under the Apache License, Version 2.0. See LICENSE.
- trash-cli (Python)
Iron Bin is written in Rust. This project is a Cargo workspace where the following crates are the most important:
- iron-bin: the library that provides the
Trashstruct - trash: the
trashbinary, which is essentially a CLI for theiron-binlibrary
It is recommended to use the Git hooks provided with this project. This can be easily achieved with Smee.