https://github.com/datsfilipe/trxsh
Trxsh is a trash cli built in Go.
https://github.com/datsfilipe/trxsh
cli go golang linux trashcan
Last synced: 4 months ago
JSON representation
Trxsh is a trash cli built in Go.
- Host: GitHub
- URL: https://github.com/datsfilipe/trxsh
- Owner: datsfilipe
- License: mit
- Created: 2025-04-13T23:32:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-23T13:48:11.000Z (about 1 year ago)
- Last Synced: 2025-08-29T01:53:51.895Z (11 months ago)
- Topics: cli, go, golang, linux, trashcan
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trxsh
[](https://github.com/datsfilipe/trxsh/actions/workflows/build.yml)
Trxsh is a simple and efficient command-line trash manager written in Go. It allows you to safely delete, list, restore, and permanently remove files from your system's trash directory.
### Table of Contents
- [Installation](#installation)
- [Features](#features)
- [Usage](#usage)
- [Trash Specification](#trash-specification)
- [License](#license)
### Installation
- Arch:
The package is now in [AUR](https://aur.archlinux.org/packages/trxsh), so to install it you can use an AUR helper like `yay`:
```bash
yay -Syu trxsh
```
or go through the process manually:
```bash
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/trxsh.git
cd yay
makepkg -si
```
- NixOS:
For now you can add a custom derivation to your NixOS config. Please refer to [derivation example](./examples/derivation.nix).
### Features
- deletion: move files to a designated trash directory instead of permanently deleting them.
- list: biew all files currently in the trash.
- restore: recover files from the trash by ID or using an interactive fzf interface.
- cleanup: permanently delete files in the trash (use --days N to keep recent files).
### Usage
```bash
Usage: trxsh [OPTIONS] [FILES]
Options:
--fzf, -f : Restore files using fzf
--list, -l : List files in trash
--restore, -r ID : Restore file by ID
--cleanup, -c : Empty trash (use --days N to keep recent files)
--dir-sizes, -s : Show directory sizes
--help, -h : Show this help
```
### Trash Specification
I've tried implementing the basics from [freedesktop.org trash specification](https://specifications.freedesktop.org/trash-spec/1.0/), but I haven't checked if eveything meets the spec. If you feel like this is an important matter, please feel free to address any issue you find with a proper PR, or to point out and I can work on that whenever I have some spare time.
### License
This project is licensed under the [MIT License](./LICENSE).