Since time immemorial I have used ... | sort | uniq -c | sort -nr to group & count input lines, to count how many of each line there is in the input.
Is there any better way? Have I just picked up a bad habit? Is there a better way using standard unix tools that will be installed on Ubuntu Linux 18.04+ (or things that are an apt-get away?)