LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2012, 04:51 AM   #1
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Rep: Reputation: 26
How can I sort this list by Month then Day order


Hello,
How can I sort this list {below} by Month then Day order
-Thanks Glenn

01-Aug-2012
01-Oct-2012
02-Nov-2012
03-Nov-2012
03-Oct-2012
04-Nov-2012
04-Oct-2012
04-Sep-2012
05-Nov-2012
05-Oct-2012
06-Nov-2012
06-Oct-2012
07-Oct-2012
08-Nov-2012
08-Oct-2012
09-Nov-2012
09-Oct-2012
10-Nov-2012
10-Oct-2012
11-Nov-2012
11-Oct-2012
12-Nov-2012
12-Oct-2012
13-Nov-2012
13-Oct-2012
14-Aug-2012
15-Oct-2012
16-Oct-2012
17-Aug-2012
17-Oct-2012
17-Sep-2012
18-Oct-2012
19-Oct-2012
22-Oct-2012
22-Sep-2012
23-Oct-2012
23-Sep-2012
24-Oct-2012
24-Sep-2012
25-Oct-2012
25-Sep-2012
26-Oct-2012
26-Sep-2012
27-Jul-2012
27-Oct-2012
27-Sep-2012
28-Jun-2012
28-Oct-2012
29-Oct-2012
29-Sep-2012
30-Aug-2012
30-Jun-2012
30-Oct-2012
30-Sep-2012
31-Oct-2012
 
Old 11-13-2012, 05:00 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Have a look at this:
Code:
sort -t- -M -k2 infile
I do believe the first column is also sorted, if not:
Code:
sort -t- -M -k2 -k1 infile
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
How to sort a list in decending order drone01 Linux - Newbie 9 09-29-2011 06:10 AM
cron job: day of month / day of week conflict? geekpie Linux - General 2 10-21-2009 03:56 AM
OpenOffice.org Calc formula to check if day is last day of the month win32sux Linux - Software 1 01-19-2009 12:38 PM
Starting day of month, month length chrisk5527 Programming 2 03-03-2004 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration