cat people.txt # john; smith; 49 # amanda; bush; 55 # john; kidman; 55 # john; bush; -9 # amanda; bush; 1 # Sort by the 3rd column sort -t ';' -k3,3n people.txt # john; bush; -9 # amanda; bush; 1 # john; smith; 49 # amanda; bush; 55 # john; kidman; 55 # Sort by 2nd, 1st and then 3rd column sort -t ';' -k2,2 -k1,1 -k3,3n people.txt # amanda; bush; 1 # amanda; bush; 55 # john; bush; -9 # john; kidman; 55 # john; smith; 49