I have a list with population, year and county, and I need to cut out the list and then find the number of uniq counties.
The list starts as follows:
3900, 1969, Beaver
3798, 1970, Beaver
3830, 1971, Beaver
3864, 1972, Beaver
3993, 1973, Beaver
3976, 1974, Beaver
4064, 1975, Beaver
This list has many more, and many more counties. I need to cut out the county column, sort it, and then output the number of uniq counties. I tried this command:
cut -c3- list.txt | sort -k3 | uniq -c
But this does not shorten the third list or sort it alphabetically. What am I doing wrong?
user2615699
source
share