command-definition.uniq.html Maven / Gradle / Ivy
Reads from the standard input or from a specified input file and compares
adjacent lines, writing one copy of each input line on the output. The
second and succeeding copies of repeated adjacent input lines are not
written to the output.
Note that repeated non-adjacent lines in the input are only detected
with the --global or -g option. In other words, unique output lines
are guaranteed only if either (a) the --global or -g option is
specified, or (b) the input lines are sorted.