I am trying to find out the frequency of appearance of every letter in the english alphabet in an input file. How can I do this in a bash script?
My solution using grep
, sort
and uniq
.
grep -o . file | sort | uniq -c
Ignore case:
grep -o . file | sort -f | uniq -ic