Linux

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

Filter log file contents between date

👤 Login to reply

    #1  
Old 05-02-2017
Maddy123 Maddy123 is offline
Registered User
 
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 05-02-2017
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
 
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
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:13 AM
Concatenate many files which contents the same date as part of name file jiam912 Shell Programming and Scripting 7 11-23-2012 09:58 AM
how to filter file for specific date guddu_12 Shell Programming and Scripting 1 08-02-2012 12:19 PM
Fetch contents of file greater than date bhallarandeep Shell Programming and Scripting 1 07-25-2011 08:06 AM
Filter date and time form a file using sed command vineet.dhingra Shell Programming and Scripting 12 04-20-2011 08:45 AM



All times are GMT -4. The time now is 11:15 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?