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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you sort both ascending and descending?

Status
Not open for further replies.

pjb

Programmer
May 1, 2001
148
US
I know that -r reverses the order into a descending sequence, but is there a way to use it on only one of the fields on a file. Sort the first field in ascending sequence, and then sort the next field descending?
 
Yes: omit the -r option and append r to the 2nd key definition.
Anyway:
Code:
 man sort

Hope This Help
PH.
 
Thanks,

That works. Never would have found that in my man page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top