This project is a cross-platform file trashing utility for the terminal that can reverse file deletion.
Tested on Linux, FreeBSD & Windows.
See docs/ for more information.
Release binaries are provided for Linux and FreeBSD.
*Requires the build2-toolchain to be pre-installed. See https://build2.org/install.xhtml
*Requires c++23 supporting compiler.
(Optional): For building compilation database use latest staged toolchain.
mkdir trash.d
cd trash.d
git clone https://github.com/Isfand/trash.git
cd trash
POSIX: ./config-init.sh
WIN32: .\config-init.ps1
bdep update -a
This should build all initialized build configurations.
To list all build configs, type: bdep config list
To clean all build configs and dependencies recursively, type: bdep clean -a -r
To update a specific config: bdep update @<config-name>
To clean a specific config: bdep clean @<config-name>
cd into your release target build configuration directory. E.G: cd ../trash-x64-posix-llvm-release
And type:
b install config.cxx.loptions="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" config.install.root="/usr/local/" config.install.sudo="sudo"
To uninstall just replace install
with uninstall
for the command above.
This should work on any POSIX compliant platform.
WIP
*Note, '--help' option changes message when applied after a primary command:
trash --version | trash --help | -h
delete | d list | l restore | r erase | e validate | v
trash delete filename trash delete -- filename
trash list, List all by default
trash restore <n> trash restore --all | -a, Restore all
trash erase <n> trash erase --all | -a, erase all
trash validate --all | -a, Validate all
TRASH_DIR
The directory where the trash/ folder will be located. Defaults to '$HOME/.trash/'. The directory filename before the last delimiter will be used as the root of the trash directory name.
E.G 'export TRASH_DIR=/home/user/.local/shared/.trashAlt/', will make .trashAlt/ become the trash directory name.
If you find the program useful then consider donating