perl -nE 'END{say"$_ => $n{$_}"for keys%n}chomp;$n{$_}++' input.txt >output.txt