Delete to the recycle bin with gio trash
gio trash sends files to the standard desktop Trash (recoverable from Files/Nautilus), unlike rm which deletes immediately and forever.
Run `gio trash <file>` to trash; restore with `gio trash --restore trash:///<name>` or open the Trash in your file manager.
01Command
Command
$ gio trash notes.txt02What it does
gio trash follows the FreeDesktop trash specification: files move to ~/.local/share/Trash with their original path recorded, so 'Delete' in the terminal behaves like 'Move to Trash' in the file manager. `gio list trash:///` and `gio trash --empty` manage the bin from the terminal, and gio works over gvfs even for remote locations.
03Risk
!Warning: Trash does not free disk space until emptied; very large files are better moved or deleted outright. On NFS or FAT volumes without a writable trash, gio may fall back to asking for a real delete.
04Undo
Undo
$ gio trash --restore trash:///<name>05Sources
- gio(1) — GIO command line toolEvidence: gio trash/mount/list commands over gvfs URIs
- Trash management — ArchWikiEvidence: describes ~/.local/share/Trash layout and gio trash usage
Last verified: 2026-09-18 · Category: Files & Folders