Linux & Terminali

uniq

Në shqip: uniq (hiq dublikatat)

ShpjegimiSQ

uniq heq rreshtat e përsëritur njëri pas tjetrit — prandaj zakonisht vjen pas sort. Me -c numëron sa herë shfaqet çdo rresht: kombinimi „sort | uniq -c | sort -nr“ është klasik.

EnglishEN

uniq removes repeated adjacent lines — which is why it usually follows sort. With -c it counts how many times each line appears: “sort | uniq -c | sort -nr” is a classic.

Si ta mendosh

Si të numërosh votat pasi i ke grupuar fletët sipas kandidatit.

Lexoje në anglisht

Like counting votes after grouping the ballots by candidate.

Shembull kodibash

awk '{print $1}' access.log | sort | uniq -c | sort -nr | head
# 1532 192.168.1.10

Terma të lidhur