I have been trying to sort specific columns with some data I have which is:
ID Name Last Grade
123 Bill Holy A
747 Chloe Crown B
757 Aaron Farmer D
365 Gray Billson
Column by column I'm trying to sort the first column (ID) in numerical order, sort the second column (Name) in alphabetical order while all other peices of data are left as they are. I'd like to do this in one whole command.
So far I have tried
sort -k1,1 -k2,2 [filename]
, but all this did was sort the first column in numerical order but the second column (Name) did not appear to have changed or have been sorted in anyway. Lastly when I ran this command it made the headers (ID, Name, Last, Grade) move to the bottom.