Giter Club home page Giter Club logo

go-trash's Introduction

go-trash

The go-trash is simple CLI, that move files and folder to the trashbox written in Go. Works on Linux and Windows 10.

Usage

$ ./go-trash -h
Usage: go-trash [-hl] [-o File] [-u File] [parameters ...]
 -h       Show help
 -l       List trashed files
 -o File  Output file to location
 -u File  Restore files to original location

Trash

  • Windows
C:\Users\user\Desktop> go-trash.exe aaa.txt bbb_dir
  • Linux
~$ ./go-trash aaa.txt bbb_dir

Print list trashed files

  • Windows
C:\Users\user\Desktop> go-trash.exe -l

# Trash Box #

InFolder        : aaa.txt
Normal          : C:\Users\user\Desktop\aaa.txt
ForParsing      : C:\$RECYCLE.BIN\S-xxx\$RABCD.txt
DateDeleted     : 2023/1/2 12:34:56
Size            : 1234

InFolder        : bbb_dir
Normal          : C:\Users\user\Desktop\bbb_dir
ForParsing      : C:\$RECYCLE.BIN\S-xxx\$R1C0U4Q
DateDeleted     : 2023/1/2 12:34:56
Size            : 0
  • Linux
~$ ./go-trash -l

# Trash Box #

FileName        : aaa.txt
Location        : /home/user/aaa.txt
DeletedDate     : 2023-01-23T12:34:56
Size            : 1234

FileName        : bbb_dir
Location        : /home/user/bbb_dir
DeletedDate     : 2023-01-23T12:34:56
Size            : 0

Restore files

If only one file or directory exists, restore it

  • Windows
C:\Users\user\Desktop> go-trash.exe -u aaa.txt
Restore         : C:\Users\user\Desktop\aaa.txt
  • Linux
~$ ./go-trash -u bbb_dir
Restore: /home/user/bbb_dir

If more than one file exists, restore the file with the selected 'ID'

  • Windows
C:\Users\user\Desktop> go-trash.exe aaa.txt ../aaa.txt
C:\Users\user\Desktop> go-trash.exe -u aaa.txt -o test.txt 
ID       DateDeleted                     FileSize        Path
0        2024-01-01 12:34:56 +0900 JST   7               C:\Users\user\Desktop\aaa.txt
1        2024-01-01 12:35:00 +0900 JST   130             C:\Users\user\aaa.txt
Which one do you restore? > 0
Restore C:\Users\user\Desktop\aaa.txt → C:\Users\user\Desktop\test.txt
  • Linux
~$ ./go-trash bbb_dir /tmp/bbb_dir
~$ ./go-trash  -u bbb -o test
ID       DateDeleted                     FileSize        Path
0        2024-01-01 12:34:56 +0900 JST   0               /home/user/bbb_dir
1        2024-01-01 12:35:00 +0900 JST   0               /tmp/bbb_dir
Which one do you restore? > 0
Restore /home/user/bbb_dir → /home/user/bbb_dir

go-trash's People

Contributors

redh00k-k avatar

Stargazers

 avatar

Watchers

 avatar

go-trash's Issues

Implementation of feature to restore files and directories

Detail

An implementation of -u to restore to the original location.

Example

  • -u
# Move to trashbox
C:\...\Desktop > go-trash aaa.txt bbb_dir
C:\...\Desktop > dir 
None

# Restore
C:\...\Desktop > go-trash -u aaa.txt bbb_dir 
C:\...\Desktop > dir 
aaa.txt bbb_dir

Implementation of feature to change the output location when restoring.

Detail

An implementation of output a file or directory to the path specified by -o.

Example

  • -o
# Move to trashbox
C:\...\Desktop > go-trash aaa.txt bbb_dir
C:\...\Desktop > dir 
None

# Output file
C:\...\Desktop > go-trash -u aaa.txt -o C:\temp\aaa.txt
C:\...\Desktop > dir C:\temp
aaa.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.