Report or omit repeated lines.

Synopsis

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

Description

Filter adjacent matching lines from input, writing unique lines to output. Input should typically be sorted first. Runs in the just-bash WASM shell inside SLICC.

Options

-c, --count Prefix lines by the number of occurrences.

-d, --repeated Only print duplicate lines.

-i, --ignore-case Ignore case when comparing.

-u, --unique Only print lines that are not repeated.

--help Display help and exit.

Examples

$ sort file.txt | uniq

Remove duplicate lines from sorted input.

$ sort file.txt | uniq -c

Count occurrences of each line.

Notes

Operates on the SLICC virtual filesystem. Only compares adjacent lines — pipe through sort first for full deduplication.

See Also

sort, wc, comm