對file文件統計單詞出現頻率:
sed -e 's/\.//g' -e 's/\,//g' -e 's/ /\n/g' "$file" | tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr
sed -e 's/\.//g' -e 's/\,//g' -e 's/ /\n/g' "$file" 去掉句號,逗號,將空格替換爲換行符
tr 'A-Z' 'a-z' 將大寫轉小寫
對file文件統計單詞出現頻率:
sed -e 's/\.//g' -e 's/\,//g' -e 's/ /\n/g' "$file" | tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr
sed -e 's/\.//g' -e 's/\,//g' -e 's/ /\n/g' "$file" 去掉句號,逗號,將空格替換爲換行符
tr 'A-Z' 'a-z' 將大寫轉小寫