The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need help in sort ali560045 Shell Programming and Scripting 2 12-04-2007 03:38 AM
sort prasathlogu UNIX for Dummies Questions & Answers 1 10-08-2007 03:56 AM
sort help unics Shell Programming and Scripting 14 04-30-2007 04:28 AM
du -h | sort ? fongthai Shell Programming and Scripting 6 11-02-2006 04:59 PM
How do i sort? abhijeetkul Shell Programming and Scripting 1 12-21-2005 11:49 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-19-2004
whatisthis's Avatar
Registered User
 

Join Date: Aug 2004
Posts: 175
Question 2nd sort key

Hi,
I was trying to sort a file with one sort key in the first field and trying to sort again based on the 2nd field.
After the sort command , the first sorted file will look like this:

1 apple OH
2 pear OH
3 pear IL
4 apple FL
5 pear FL
6 apple MI

I'd like to have it sort on the 2nd field base on this result.
Like in excell using sort by column A and then sort by column B thing.

Is there a way to do it?

THAX!

Last edited by whatisthis; 10-19-2004 at 03:27 PM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-20-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,865
Code:
sort -k 8 -k 5
Sorts on the eigth word(field) first, then the fifth.
see man sort
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0