Delete duplicated lines.
GNU core utilities has 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.
Simply type the following commands.
$ brew tap tamada/brew # only the first time.
$ brew install uniq2
Simply type the following command.
$ go get github.com/tamada/uniq2
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.
docker run --rm -v $PWD:/home/uniq2 tamada/uniq2:latest [OPTIONS] [ARGUMENTS...]
The meaning of the options of above command are as follows.
--rm
-v $PWD:/home/uniq2
$PWD in the host OS to /home/uniq2 in the container OS.$PWD must be the absolute path.Content type
Image
Digest
Size
4.9 MB
Last updated
over 6 years ago
docker pull tamada/uniq2