uniq2

Build Status Coverage Status codebeat badge Go Report Card License Version

Description

Delete duplicated lines.

GNU core utilities have uniq command for deleting duplicate lines. However, uniq command deletes only continuous duplicate lines. When deleting not continuous duplicate lines, we use sort command together, in that case, the order of the list was not kept.

We want to delete not continuous duplicated lines with remaining the order.

Install by Homebrew

Simply type the following commands.

$ brew tap tamada/brew # <- only the first time
$ brew install uniq2

Install by Go

Simply type the following command.

$ go get github.com/tamada/uniq2

Usage

uniq2 [OPTIONS] [INPUT [OUTPUT]]
OPTIONS
    -a, --adjacent        delete only adjacent duplicated lines.
    -d, --delete-lines    only prints deleted lines.
    -i, --ignore-case     case sensitive.
    -h, --help            print this message.

INPUT                     gives file name of input.  If argument is single dash ('-')
                          or absent, the program read strings from stdin.
OUTPUT                    represents the destination.

License

WTFPL