I want to keep only one permutation among a set of strings and count the occurence of each permutation.
To make things more clear, I want to transform (for instance)
ab
acf
ba
cfa
acf
into
2 ab
3 acf
where 2 and 3 are the number of permutations of {a,b} and {a,c,f} respectively.
How would you do it in bash in the straightest possible way?