##This page is still under development...

title: Uniq Command output: html_notebook
---

UNIQ Commands structure :

uniq [OPTION]... [INPUT [OUTPUT]]

Options

-c, --count Prefix lines with a number representing how many times they occurred.

For example:

$ cat data.txt 
aaaaaa
aaaaaa
cccccc
aaaaaa
aaaaaa
bbbbbb
$ cat data.txt | uniq
aaaaaa
cccccc
aaaaaa
bbbbbb

uniq requires sorted input since it compares only consecutive lines:

$ cat data.txt | sort | uniq
aaaaaa
bbbbbb
cccccc