Sponsored Content
Full Discussion: Sorting by date and time
Top Forums UNIX for Dummies Questions & Answers Sorting by date and time Post 302125953 by vgersh99 on Monday 9th of July 2007 08:47:16 AM
Old 07-09-2007
Quote:
Originally Posted by lorcan
I have just copied a line and checked and i think it works fine

Command
Code:
sort -n file

Output

Code:
27-May-2007 00:43:17.93 > From: "bLASD Booster" <vxcv@xvx.com>
27-May-2007 00:43:17.93 tcp_local conversion E 2 vxcv@xcvxo.com rfc822;xghg@xhghvx.xgjx.ie vxv@xghj.ghjx.ie /queue/queue/conversion/ZZf0z5x36o5Q4.00 <0019gjgcvbf0$0@f4a04cbcb2b> mailsrv part-e489ghjg52.cpe.polou.com ([200.255.101.255])
27-May-2007 00:43:17.93 > X-Mailer: Microsoft Outlook Express %OE_VERSION%OE_SUBVERSION
27-May-2007 00:43:18.18 > From: "gregeg Meskimen" <vzxvczx@xzcvz.co.uk>
27-May-2007 00:43:18.28 > From: "gregeg Meskimen" <vzxvczx@xzcvz.co.uk>
27-May-2007 00:43:18.28 tcp_local conversion E 9 sdf@gcvbcb.co.uk rfc822;ambury@xvxv.xcv.ie ambury@xcvxv.sds.ie /queue/queue/conversion/ZZfcbcb36o5Q5.00<00bccbc38390$92cd2fbe@Erick> mailsrv pc-146-205-47-190.cm.vtr.net ([255.47.8.146]
27-May-2007 00:43:18.48 > From: "gregeg Meskimen" <vzxvczx@xzcvz.co.uk>

... and if you add?:
Code:
31-Dec-2007 00:15:18.20 > From: "gregeg Meskimen" <vzxvczx@xzcvz.co.uk>

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sorting on date

I have a file where dates in the form mm/dd/yyyy is the first field. How do I sort the file by the date field? Thanks, Duckman (6 Replies)
Discussion started by: Duckman
6 Replies

2. UNIX for Dummies Questions & Answers

date sorting

Hi at all, I have to sort a log file on timestamp field. That's field is the third! a log file sample..... 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:23|0.3.8 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:16|0.3.8 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:20|0.3.8... (3 Replies)
Discussion started by: nmilella
3 Replies

3. Shell Programming and Scripting

Date Sorting

Hi, I have a list of files that take on the format ABCDE_yymmdd and wish to sort them in ascending date order. I can't use the unix time stamp for the file as this could possibly be different from the date given in the file name. Does anyone know of any way this can be done using unix shell... (14 Replies)
Discussion started by: LiquidChild
14 Replies

4. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

5. Shell Programming and Scripting

Date and Time sorting

Hi Guys! i have a problem of sorting column chronologically because the data i have in column is in the following format 06/Dec/2006:18:09:54 and need to be sorted in the following way (upto seconds) 06/Dec/2005:18:09:50 06/Dec/2005:18:09:51 31/Mar/2006:19:30:41 24/Oct/2006:19:16:19... (4 Replies)
Discussion started by: me_newbie
4 Replies

6. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

7. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

8. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

9. Shell Programming and Scripting

Sorting by date

I am trying to sort by two columns. The first column in an ID, the second is a date in the form yyyy-mm-dd. I need to sort by the ID column, then in ascending order for the date column (earliest date to most recent date compared to today). Input data: 012-abc 2012-04-25 ... (3 Replies)
Discussion started by: mollydog11
3 Replies

10. Shell Programming and Scripting

Sorting data file by date and time

Hello. Sorting data file by date and time with the following issues: Date is in the following format m/d/yyyy, no leading zeros Time is in the following format h:m:s AM/PM, no leading zeros Any ideas on how to sort data when the above issues? Could the date/time be converted inline to... (5 Replies)
Discussion started by: JimBurns
5 Replies
lpq(1)                                                              Apple Inc.                                                              lpq(1)

NAME
lpq - show printer queue status SYNOPSIS
lpq [ -E ] [ -U username ] [ -h server[:port] ] [ -P destination[/instance] ] [ -a ] [ -l ] [ +interval ] DESCRIPTION
lpq shows the current print queue status on the named printer. Jobs queued on the default destination will be shown if no printer or class is specified on the command-line. The +interval option allows you to continuously report the jobs in the queue until the queue is empty; the list of jobs is shown once every interval seconds. OPTIONS
lpq supports the following options: -E Forces encryption when connecting to the server. -P destination[/instance] Specifies an alternate printer or class name. -U username Specifies an alternate username. -a Reports jobs on all printers. -h server[:port] Specifies an alternate server. -l Requests a more verbose (long) reporting format. SEE ALSO
cancel(1), lp(1), lpr(1), lprm(1), lpstat(1), http://localhost:631/help COPYRIGHT
Copyright 2007-2011 by Apple Inc. 16 June 2008 CUPS lpq(1)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy