Trash management

To prevent accidental deletion of files, you can use a trash can. To ensure compatibility between multiple applications, you can use software (CLI, GUI or Library) that follows the
FreeDesktop.org's Trash specification
.
Note
Some applications can use a trash can per filesystem. If that’s not the case, deleting files on another filesystem than your
$HOME
can induce some latency because the files will be transferred between filesystems.
Tools
Most GUI file managers, such as
GNOME Files
and
Dolphin
, natively support moving files into the trash and managing its content.
Electron Applications need
trash-cli
to use the trash.
Command line
This article or section needs expansion.
Reason:
Add other utilities (Discuss in
Talk:Trash management
)
glib2
provides a
gio trash
command, see
trash
in
gio(1) § COMMANDS
. The
gvfs
package is required to fully support trash management, e.g.
gio trash --list
.
kde-cli-tools
provides a
kioclient
command that can be used as
kioclient move
file
trash:/
to move
file
to the trash.
trash-cli
— Command line trashcan (recycle bin) interface, used
https://github.com/andreafrancia/trash-cli
||
trash-cli
trash-d
— drop-in replacement for GNU rm, focusing on compatibility and with much better performance, written in D.
https://github.com/rushsteve1/trash-d
||
trash-d
AUR
trashy
— simple, fast, and featureful alternative to rm and trash-cli written in rust
https://github.com/oberblastmeister/trashy
||
trashy
AUR
trashy-bin
AUR
trashy-git
AUR
gtrash
— A featureful trash CLI manager written in Go
https://github.com/umlx5h/gtrash
||
gtrash-bin
AUR
python-send2trash
— Send file to trash natively
https://github.com/hsoft/send2trash
||
python-send2trash
trashman
— A Python trash manager
https://github.com/Kwpolska/trashman
||
trashman
AUR
rmtrash
— trash-put made compatible to GNUs rm and rmdir
https://github.com/PhrozenByte/rmtrash
||
rmtrash
AUR
rmw (ReMove to Waste)
— A trashcan/recycle bin utility for the command line.
https://theimpossibleastronaut.com/rmw-website/
||
rmw
AUR
Automatic cleaning
autotrash
— Tool to automatically purge old trashed files
https://github.com/bneijt/autotrash
||
autotrash
AUR
Dolphin
can automatically remove files older than a give number of days, and warn you or remove older or bigger files if the trash can goes above a size threshold.
See official documentation
.
GNOME
can automatically remove older files,
see official documentation
.
rmw (ReMove to Waste)
— A trashcan/recycle bin utility for the command line, that can automatically remove files older than a given number of days,
see CONFIGURATION in the manual
https://theimpossibleastronaut.com/rmw-website/
||
rmw
AUR
Troubleshooting
Unable to find or create trash directory
External drives
/etc/fstab
might not be set correctly. Note that
ID
must be replaced by your own user id by
$ id
.
/etc/fstab
# <device>                                <dir>              <type>    <options>         <dump> <fsck>
UUID=75667752-8b06-11ea-bc55-0242ac130003 /externalDrive     ntfs-3g   defaults,uid=ID   0      1
Make sure that the root directory of the drive contains
~/.Trash-1000/{expunged,files,info}
and set relevant read permissions for the directory and sub-directory.