-1

I have a very large set of strings, one on every line of a file. Many strings occur more than one times in the file at different locations.

I want a frequency count of the strings using unix commands like awk, grep, uniq and so on. I tried few combinations but it didn't work.

what is the exact command to get the frequency count?

London guy
  • 27,522
  • 44
  • 121
  • 179
  • Please improve your question by posting some [properly formatted](http://stackoverflow.com/editing-help) code you've applied to the problem, all **relevant** error messages exactly as they appear, and whatever samples you're testing against. Also, please include a properly-formatted sample of your **expected output** so folks understand the results you're trying to achieve. – Todd A. Jacobs Apr 14 '13 at 07:46
  • Thanks! Shall update it then. – London guy Apr 14 '13 at 07:47

1 Answers1

7

To count the occurrences of lines in a file the simplest thing to do is:

$ sort file | uniq -c 
Chris Seymour
  • 83,387
  • 30
  • 160
  • 202