1

I have something like this

teithe.gr
List item
deitel.com
parinux.org
cs.vt.labs.edu
cs.may.ie
csse.monash.edu.au
amazon.com
amazon.com
teithe.gr
teithe.gr

I just want to know how can I count each word in an output like this

teithe.gr 3
amazon.com 2 
....etc
4

You can use

sort inputfile | uniq -c

The output is not exactly as you specified:

      2 amazon.com
      1 cs.may.ie
      1 cs.vt.labs.edu
      1 csse.monash.edu.au
      1 deitel.com
      1 List item
      1 parinux.org
      3 teithe.gr

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.