Skip to Content
gnux

-c, --count

Prefix lines by the number of occurrences.

An option of uniqx.

Usage

uniqx -c [INPUT [OUTPUT]]
uniqx --count [INPUT [OUTPUT]]

Details

ShortLongValueDefaultMeaning
-c--countnoneprefix lines by the number of occurrences

Examples

Users report errors from your web server: see how its responses split between status codes, drawn as a histogram on the terminal

cutx -d' ' -f9 access.log | sortx | uniqx -c

Count the occurrences of each line

uniqx -c sorted.txt

Deduplicate in the portable gnux shell

gnux shell -c 'catx sorted.txt | uniqx -c'

Help in the terminal

gnux help uniqx --count

On this page