我试图找出输入文件中英文字母表中每个字母的出现频率。我如何在 bash 脚本中执行此操作?
最佳答案
我的解决方案使用 grep
、sort
和 uniq
。
grep -o . file | sort | uniq -c
忽略大小写:
grep -o . file | sort -f | uniq -ic
关于linux - 用于查找文件中每个字母出现频率的 Bash 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3966820/