I have a simple file like this:
Term1 column2 column3
Term2 column2 column3
Term3 column2 column3
Term2 column2 column3
Term1 column2 column3
Term2 column2 column3
If I sort on the first column and get a count for the terms:
cut -f1 -d ' ' file | sort | uniq -c
The results shows me this:
2 Term1
3 Term2
1 Term3
But I would rather see this:
Term1 2
Term2 3
Term3 1
Is there an easy way to "change" the uniq output to do this or would i still need to pipe the output to sed or awk to get this?
This seems a simple question so my apologies if this was asked before.