Someone else mentioned using a hash table to accumulate counts; that approach would give something like
~/bin/freq
==========
#! /bin/bash
awk '{acc[$0]++} END {for (item in acc) {print acc[item], item}}' | sort -nr