h4ckm1n-dev / gotrash

GoTrash is a simple command-line tool written in Go that moves files to the trash instead of deleting them permanently. It act has a proxy for the rm command, and it provides a safer alternative to the rm command, allowing users to recover files if needed as use all rm options.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoTrash πŸ—‘οΈ

GoTrash is a simple command-line tool written in Go that moves files to the trash instead of deleting them permanently. It act has a proxy for the rm command, and it provides a safer alternative to the rm command, allowing users to recover files if needed as use all rm options.

Build Status

Go

Compatibility πŸ“¦

Gotrash has only been tested on ubuntu 24.04 and 22.04, but it should work on most Linux distributions and macOS.

Features ✨

  • Move files to the trash instead of permanently deleting them
  • Simple and easy-to-use command-line tool, with a similar interface to rm
  • Compatible with most shell environments
  • Option to display help information

Installation πŸš€

To use GoTrash, you can either compile the source code yourself or download the precompiled binaries from the Releases page.

From Source

Clone this repository:

git clone https://github.com/h4ckm1n-dev/gotrash.git

Navigate to the repository directory:

cd gotrash

Compile the source code:

go build -o gotrash

Move the generated binary to a directory in your PATH, for example:

sudo mv gotrash /usr/local/bin

Optionaly you can alias gotrash to rm

alias rm="gotrash"

Usage πŸ› οΈ

gotrash [OPTION]... [FILE]...
[OPTION]: Optional arguments, including -h or --help to display help information.
[FILE]...: List of files to move to the trash.

Examples

Move a single file to the trash:

gotrash example.txt

Move multiple files to the trash:

gotrash file1.txt file2.txt file3.txt

For more options, run:

gotrash --help

License πŸ“

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing 🀝

Contributions are welcome! Feel free to open issues or submit pull requests.

Acknowledgments πŸ™

This project was inspired by rmtrash by Sindre Sorhus.

About

GoTrash is a simple command-line tool written in Go that moves files to the trash instead of deleting them permanently. It act has a proxy for the rm command, and it provides a safer alternative to the rm command, allowing users to recover files if needed as use all rm options.


Languages

Language:Go 100.0%