Pablo
Pablo

Reputation: 29519

How to sort tab delimited out?

In linux(Ubuntu), one shell utility will output the following data

23827492      name_1
3984989229      name 2
8238937      another name

so there are 2 fields, number and name. What I need is to sort this output by the numbers in asc or desc in linux shell. What is the easiest way without engaging python/perl?

Upvotes: 1

Views: 1209

Answers (1)

jman
jman

Reputation: 11616

Try this:

sort -g <filename>

And use -r for reverse sort

Upvotes: 2

Related Questions