
stackoverflow.com
https://stackoverflow.com/questions/9471101/sort-c…
Sort CSV file by multiple columns using the "sort" command
Since you want to sort on 3 columns, you'll need to specify -k 3 times, for columns 2,2, 1,1, and 3,3. To put it all together, Note that sort can't handle the situation in which fields contain the separator, even if it's escaped or quoted. Also note: this is an old question, which belongs on UNIX.SE, and was also asked there a year later.