![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| finding the file which is modified within last 2 hours | trichyselva | Shell Programming and Scripting | 5 | 06-04-2009 02:53 PM |
| Searching for folders which are over 5 hours old. | stevefox | Shell Programming and Scripting | 4 | 06-02-2008 12:13 AM |
| Have we just had a rollback of a few hours? | porter | Post Here to Contact Site Administrators and Moderators | 1 | 12-17-2007 08:51 PM |
| list the file created before 24 hours using ls command | jayaramanit | Shell Programming and Scripting | 7 | 09-11-2007 09:46 AM |
| delete files that are over 2 hours old | hedrict | UNIX for Dummies Questions & Answers | 3 | 07-01-2002 01:06 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Last 24 hours of a log file
I'm looking to pull the last 24 hours of a log file.
Here's what I've got so far: yesterday=$(TZ=$TZ+24 date +"%b %e %H:%M") today=$(date +"%b %e %H:%M") echo $yesterday $today grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log But that pulls everything from $yesterday from 12:01am instead of 24 hrs prior to the current date and time. Thoughts? Thanks... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|