Sorting data based on second column of a file

I have a file of two columns and n number of rows.

column 1 contains names and column2 age.

I want to sort the content of this file in ascending order based on the age (in second column).

The result should display the name of the youngest person along with name and then second youngest person and so on…

Any suggestions for a one liner shell or bash script.

4 Answers
4

Leave a Comment