Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with the Unix "sort" command

Status
Not open for further replies.

rogers42

Technical User
Mar 30, 2007
64
CA
Hi Folks,

I need help with the "sort" command syntax. Essentially, I would like to sort the data (in descending order) on the second field

Sample Data:
============
:03.mpg: 14
:03TB.mpg: 8
:04TV_NR.mpg: 8
:102_FINAL.MPG: 11

Desired Results:
=================
:03.mpg: 14
:102_FINAL.MPG: 11
:03TB.mpg: 8
:04TV_NR.mpg: 8

My sort command:
================
sort +0nr title_count.log | more

Needless to say, the above command does not give me the correct order.

I shall appreciate any assistance.

Thanks in advance.

rogers42




 
Figured it out :)

The command should have been
"sort +1nr title_count.log | more"

Thanks

rogers42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top