How to create a frequency list of every word in a file?

前端 未结 11 959
心在旅途
心在旅途 2020-12-04 09:59

I have a file like this:

This is a file with many words.
Some of the words appear more than once.
Some of the words only appear one time.

I

11条回答
  •  独厮守ぢ
    2020-12-04 10:39

    Not sed and grep, but tr, sort, uniq, and awk:

    % (tr ' ' '\n' | sort | uniq -c | awk '{print $2"@"$1}') <

提交回复
热议问题