Friday, 1 April 2011

count the appearance of the first letter of a file

sort < file_name | sed -e "s/\(.\).*/\1/" | uniq -c
      9 a
      7 b
     22 c
     10 d
      2 e
      5 f

No comments:

Labels

Search This Blog