Why is the purchase data sorted before applying uniq?
uniq
uniq compares adjacent lines, and sorting groups equal lines together.
uniq can read only alphabetically ordered characters.
sort calculates the occurrence counts that uniq merely displays.
sort
Sorting deletes the original file so uniq cannot modify it.