rtrash shares the trash with trash-cli, gtrash, GNOME’s gio trash
and the desktop file managers built on it. This page records what
matches and what differs. The Linux rows come from live runs against
trash-cli 0.26.9.29, gtrash and gio 2.84 on one shared trash. CI repeats
the cross-restore rows on every push with scripts/interop-smoke.sh,
in all sixteen pairings.
trash-cli command lines#
Linked as trash-put, trash-list, trash-empty,
trash-restore and trash-rm, rtrash takes a trash-cli command
line as is.
trash-cli |
rtrash under the trash-* name |
|---|---|
|
same; |
|
same; tcsh has no script (exit 2) |
zsh matcher-list (trash-cli #363) |
restore and rm complete trashed paths (and names) through compadd, so matcher-list applies; all six scripts complete them |
|
same |
|
same |
|
same |
|
same rows; |
|
same |
|
same |
|
same |
|
same; DAYS also takes an age
such as |
|
same prompt, then empties |
|
same |
unscoped |
asks or refuses unless every
item came from the latest put;
|
|
same scope and “No files trashed” message |
|
same: the item at PATH and items from under it |
|
same |
|
same |
|
same; no match exits 0 |
On a terminal, trash-restore and trash-empty open the rtrash
browser; --plain keeps the numbered prompt. rtrash restore with
no PATH offers every item, and a PATH must match exactly; only the
trash-restore name narrows to the current directory.
Beyond trash-cli and gtrash#
These exist only in rtrash: rm(1) flags on put, undo of the last
put run, size budgets (empty --max-size), du and reap,
--json on every listing, and the restore conflict policies
(--conflict=rename|skip), which restore --dry-run previews. A
read-only home trash fails put up front with one clear reason, since it
has no fallback; trash-cli fails each item with a bare error.
trashy patterns#
trashy takes its patterns as plain arguments to restore and
empty, read as regular expressions unless -m (--match) names
another kind. In rtrash a flag names the kind:
trashy |
rtrash |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A regex for rm searches the whole original path, on the FreeDesktop,
Finder and Windows trashes alike. One that matches every path (such as
.*) needs --force, as * does. restore -m and rm -m
with substring or exact read the text against the original path
as trashy does; only the default differs (glob here, regex in trashy).
macOS#
Behaviour |
rtrash |
Finder |
|---|---|---|
Plain |
Finder Trash |
yes |
Put Back after a plain put |
yes; Finder records it |
yes |
Plain |
Finder Trash, by Put Back location |
yes |
|
same matchers as restore, on the Finder Trash and Windows too |
no |
|
every check, nothing moves (Windows too) |
no |
bare |
substring or glob, like |
no |
|
fields {date} {path} {name} {size} …, raw bytes, \0 rows; Finder and Windows too |
no |
|
one |
no |
WSL: |
opt-in, |
no |
WSL: list, restore and delete Recycle Bin items |
|
no |
|
one put run as a unit (same as |
no |
FreeDesktop home trash |
|
no |
|
Finder Trash; undo from a put-run log |
n/a |
Symbolic links |
move in as themselves, without Put Back |
follows |
Volume trash |
plain commands, as Finder; put there for items on the drive |
yes |
Permanent delete ( |
Finder trashes, by Put Back path or name |
no |
Permanent delete of one put run
( |
Finder trashes, by the put log; Windows:
|
no |
Composed vs decomposed names (NFC/NFD) |
match alike in list, restore, rm and undo; restore –name/–glob/–regex on every trash |
n/a |
Age filters count from the move into the trash and size filters from
disk usage; restore takes --name, --glob, --regex,
--latest and --to. trash-stats --total and --history
read a total and history per Finder trash kept under
$XDG_STATE_HOME/rtrash/finder-totals: put, rm, empty, restore and
undo carry a current total, inodes included, by the items they move; a
change made outside rtrash marks the total stale until --measure.
empty --max-size and --prune trim the Finder trashes together,
by disk usage. RTRASH_MAX_SIZE and policy.max_size trim each
Finder trash a put used, sparing what that put moved.
empty --until-free and reap --purge-trash empty the oldest
Finder items first on a short file system, since a put there goes to the
Finder Trash. empty --dangling needs FreeDesktop records, so on the
Finder Trash it is refused with a hint. CI runs plain put, list, restore
and empty on a real macOS runner against Finder.