Skip to content

ravilock/dedupgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dedupgo

Simple duplicate file finder written in Go. Can be used to find identical files under a directory programmatically or via CLI.

Contributing

Feel free to open issues for bugs, feature requests, improvements and missing tests.

Following Pull Requests will be appreciated!

Installation and Usage

CLI

go install github.com/ravilock/dedupgo@latest

Dedupgo can be used with CLI

Basic Usage

dedupgo find directory-path

This will iterate over the files in the passed directory looking for files that have the same content

Recursive

dedupgo find directory-path -r

This will recursively search through all sub-directories of the passed directory looking for files that have the same content, this option will only stop when there are not sub-directories left

In-Depth

dedupgo find directory-path -d 4

This works similarly to recursive but will define a sub-directory depth limit, this will only dive to the 4-th directory depth

Library

Use in your Go project:

go get github.com/ravilock/dedupgo/dedup
import (
	"fmt"

	"github.com/ravilock/dedupgo/dedup"
)

func main() {
	result, err := dedup.Find("/home/raylok/projects/dedupgo-test")
	if err != nil {
		fmt.Println(err)
		return
	}
	for hash, value := range result {
		fmt.Printf("%s are duplicated files under hash %q\n", value, hash)
	}
}

About

Simple duplicate file searcher written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published