libtrash(2)

NAME
libtrash - Linux Trash Can

SYNOPSYS
libtrash is a preloaded library that intercepts system unlink(2) command and moves a deleted file to a designated trashcan.

DESCRIPTION
libtrash is a shared library which, when preloaded, will intercept calls to a series of GNU libc functions and make sure that, if an attempt to destroy certain files is made, these won't be permanently destroyed but rather moved to a "trash can". It also allows the user to mark certain directories as "unremovable", which means that calls to functions which would result in the loss of files under these directories will always fail, leaving those files untouched in their original locations.

OPTIONS
libtrash is configured using a user config file that controls how to-be-removed files are handled.

EXIT STATUS
If there is an error in removing the file, a system error will be reported.

RETURN VALUE
libtrash is preloaded and is not called directly by a user program. If unlink (2) returns an error, it is displayed.

ERRORS
libtrash will return an error if a file cannot or should not be removed.

ENVIRONMENT
LD_PRELOAD = "library path/libtrash.so"
TRASH_OFF = "YES|NO"
prepending a rm or mv command with TRASH_OFF=YES will disable trash can functionality.

FILES

/etc/libtrash.conf
    This file is an annotated version with all options explained.

$HOME/.libtrash
    This is a user created configuration file.

BUGS
Probably!

AUTHORS
Manuel Arriaga - 2002 through 2024/01
Peter Hyman - 2024/01 through...
Other contributors over the years are listed in the doc/libtrash directory

SEE ALSO
rm(1), mv(1), unlink(2), libtrash.conf(5)