0

Say I have a test output generated by cat some_file | grep some_text, and the output is like the following:

some text: 123123
some text: 123123
some text: 123123
some text: 123123
some text: 345345
some text: 123123
some text: 345345
some text: 345345

I want to have a summary of each line's frequency from this text like:

some text: 345345 => 3
some text: 123123 => 5

How to do that in bash?

IsaIkari
  • 1,002
  • 16
  • 31

0 Answers0