Count occurences of character X in all files in current directory
If you ever need to count the occurences of a character in all (or some) files, this next series of commands would come in handy: for f in `ls`; do cat $f; done | awk ‘{ for ( i=1; i<=length; i++ ) arr[substr($0, i, 1)]++ }END{ for ( i in …