How do you find repeated words in Linux?

Lan Anh

New member
How do you find repeated words in Linux?
Answer
Explanation
  1. First you can tokenize the words with grep -wo , each word is printed on a singular line.
  2. Then you can sort the tokenized words with sort .
  3. Finally can find consecutive unique or duplicate words with uniq . 3.1. uniq -c This prints the words and their count.
 

Tìm kiếm

Back
Top