Unix/Linux Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Filter log file contents between date

Linux


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-02-2017   -   Original Discussion by Maddy123
Maddy123's Unix or Linux Image
Maddy123 Maddy123 is offline
Registered User
 
Join Date: May 2011
Last Activity: 3 August 2017, 8:24 PM EDT
Posts: 133
Thanks: 32
Thanked 1 Time in 1 Post
Filter log file contents between date

Hi,

Could you please provide me command to filter contents between date in a log file?

Say for example, in a log file I want to capture contents between date May 01 from 5am to 9 am.


OS -- Linux

Regards,
Maddy
Sponsored Links
    #2  
Old Unix and Linux 05-02-2017   -   Original Discussion by Maddy123
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 January 2018, 9:34 AM EST
Location: NM
Posts: 11,284
Thanks: 581
Thanked 1,127 Times in 1,038 Posts
Does your Linux have a command, dgrep?



Code:
which dgrep

will show you if the command is available.

dgrep is date grep - it is meant to do exactly what you asked for.
If you don't have it, install the dateutuils package for your system.

PS: showing sample input and expected output really helps get better answers than what I just gave.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Folder contents getting appended as strings while redirecting file contents to a variable vivek d r Shell Programming and Scripting 2 03-29-2013 05:13 AM
Concatenate many files which contents the same date as part of name file jiam912 Shell Programming and Scripting 7 11-23-2012 10:58 AM
how to filter file for specific date guddu_12 Shell Programming and Scripting 1 08-02-2012 01:19 PM
Fetch contents of file greater than date bhallarandeep Shell Programming and Scripting 1 07-25-2011 09:06 AM
Filter date and time form a file using sed command vineet.dhingra Shell Programming and Scripting 12 04-20-2011 09:45 AM



All times are GMT -4. The time now is 05:57 PM.