README.md
author Mikael Berthe <mikael@lilotux.net>
Wed, 23 Feb 2022 22:56:53 +0100
changeset 45 ea6a9ba7a3c8
parent 31 9962a52201ba
permissions -rw-r--r--
Display existing hard links in result sets This is a breaking change in the plain text output, but somehow the list displayed in case of existing hard links was arbitrary, since the all the hardlinked filenames were not displayed. Here's a sample JSON result with this patch: { "file_size": 9216, "paths": [ "test_tree/f09-1_5.raw", "test_tree/f09-4_5.raw" ], "links": { "test_tree/f09-1_5.raw": [ "test_tree/f09-2_5.raw", "test_tree/f09-3_5.raw" ], "test_tree/f09-4_5.raw": [ "test_tree/f09-5_5.raw" ] } } Here the 5 files have the same contents, but there are two hardlink groups: "test_tree/f09-1_5.raw" "test_tree/f09-2_5.raw" "test_tree/f09-3_5.raw" are hard-linked, and "test_tree/f09-4_5.raw" "test_tree/f09-5_5.raw" are hard-linked. Here's the same set displayed With the regular text output: Group #5 (2 files * 9216 bytes): test_tree/f09-1_5.raw test_tree/f09-2_5.raw test_tree/f09-3_5.raw test_tree/f09-4_5.raw test_tree/f09-5_5.raw (The link file names are indented using 1 space character.)

# goduf

Goduf is a fast duplicate file finder.
It is a command line tool.

[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://raw.githubusercontent.com/McKael/goduf/master/LICENSE)
[![Build Status](https://travis-ci.org/McKael/goduf.svg?branch=master)](https://travis-ci.org/McKael/goduf)

## Usage

The typical usage is very simple:

```
% goduf DIRS...
```

Examples:

```
% goduf /usr/bin
Group #1 (2 files * 76 bytes):
/usr/bin/vam
/usr/bin/vim-addons

Group #2 (2 files * 292 bytes):
/usr/bin/pip
/usr/bin/pip2

Group #3 (3 files * 1134 bytes):
/usr/bin/gajim
/usr/bin/gajim-history-manager
/usr/bin/gajim-remote

Group #4 (2 files * 1303 bytes):
/usr/bin/pdftexi2dvi
/usr/bin/texi2pdf

Group #5 (7 files * 4791 bytes):
/usr/bin/ansible
/usr/bin/ansible-console
/usr/bin/ansible-doc
/usr/bin/ansible-galaxy
/usr/bin/ansible-playbook
/usr/bin/ansible-pull
/usr/bin/ansible-vault

(...)
```

```
% goduf -summary /usr/share/doc
2018/04/07 21:48:23 Final count: 5970 duplicate files in 1920 sets
2018/04/07 21:48:23 Redundant data size: 107594575 bytes (102 MiB)
```

Use `goduf -h` to get the list of available options.

*Note for Windows users:* goduf does not normalize paths on Windows, so be careful not to specify the same path twice.

On Linux, hard links are automatically excluded.

## Installation:

From the Github mirror:

```
% go get github.com/McKael/goduf
```

From my Mercurial repository (upstream):

```
% hg clone https://hg.lilotux.net/golang/mikael/goduf
% cd goduf
% go build
```

Please note that if you're not using Go v1.11 yet, you should clone the
repository in your $GOPATH.