Given an input file containing one single number per line, how could I get a count of how many times an item occurred in that file?
cat input.txt 1 2 1 3 1 0
Another option:
awk '{n[$1]++} END {for (i in n) print i,n[i]}' input.txt | sort -n > output.txt