Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

uniq

Report or filter out repeated lines

Syntax

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

Common Options

-cCount occurrences
-dShow only duplicates
-uShow only unique
-iIgnore case

Common Examples

uniq file.txt

Remove adjacent duplicates

uniq -c file.txt

Count duplicates

sort file.txt | uniq

Remove all duplicates

Related Commands

Related Tools

More Code & Dev Tools