Uniq
|
From Linuxconfig.org
.. back to the list of Linux Commands
Name
uniq - report or omit repeated lines
Synopsis - man page
uniq [OPTION]... [INPUT [OUTPUT]]
Frequently used options
-i, --ignore-case
ignore differences in case when comparing
-u, --unique
only print unique lines
Examples
Suppose we have a file with content:
$ echo -e "a\nb\nA\nc\nd\nc\nE\ne" > file
unig command will print only unique lines within file:
NOTE: Only consecutive lines counts as NOT unique.
$ uniq file
Ignore differences in case when comparing a file:
$ uniq -i file

















