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
If I have the following text in my file.txt.
This is line number one
This is Line Number Tow
this is Line Number tow
I can find the frequency of each word using the following cmd.
cat file.txt | tr ' ' '\n' | sort | uniq -c
output :
3 is
1 line
2 Line
1 number
2 Number
1 one
1 this
2 This
1 tow
1 Tow