09-29-2008
search latest version of log file
Have checked the forums and couldnt locate help on this.
I want to grep a log file for a pattern using a script - I need to grep the latest log file and not sure how I am able to ensure I am greping the latest log file.
Here is sample of log files for yestersday and I effectively need to grep the file with version number 28 below - but obviously this version number could be different depending on time of day as it may have increased....
Any help?
-rw-r--r-- 1 user1 other 15925895 Sep 28 08:39 20080928_19.log
-rw-r--r-- 1 user1 other 15925032 Sep 28 08:54 20080928_20.log
-rw-r--r-- 1 user1 other 15928665 Sep 28 09:10 20080928_21.log
-rw-r--r-- 1 user1 other 15925819 Sep 28 09:25 20080928_22.log
-rw-r--r-- 1 user1 other 15927413 Sep 28 09:41 20080928_23.log
-rw-r--r-- 1 user1 other 15925002 Sep 28 09:56 20080928_24.log
-rw-r--r-- 1 user1 other 15927538 Sep 28 10:12 20080928_25.log
-rw-r--r-- 1 user1 other 15925392 Sep 28 10:27 20080928_26.log
-rw-r--r-- 1 user1 other 994628 Sep 28 10:50 20080928_27.log
-rw-r--r-- 1 user1 other 183662 Sep 28 23:59 20080928_28.log
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am currently taking a Unix programming class in school, I want ot know which is more efficient and quicker, downloading the os or buying the os (4 Replies)
Discussion started by: lavonte
4 Replies
2. UNIX for Dummies Questions & Answers
I want to buy it (2 Replies)
Discussion started by: LANSTARR.COM
2 Replies
3. Shell Programming and Scripting
:o How do I confirm that the script on one server is latest compare to other servers? Is there any script which can tell me the latest version of a file across the servers?
Thanks, (2 Replies)
Discussion started by: Sandy
2 Replies
4. BSD
Any body there ? What is latest BSD version ? (4 Replies)
Discussion started by: chilaka
4 Replies
5. Shell Programming and Scripting
Hi,
In need to write a bash script which will be run periodically to check the files in a target directory. This receives files on an ad hoc basis and the script need to compare the time stamp of the latest file received with system time and write a message to the server log file if the time... (2 Replies)
Discussion started by: mark_s_g
2 Replies
6. Shell Programming and Scripting
I've been finding myself using a log file colorizer written in perl to reformat and colorize the output from many different programs. Mainly, however, I use it to make the output from "tail -f" commands more readable.
The base perl script I use is based on "colorlogs.pl" available from the... (1 Reply)
Discussion started by: rcsteiner
1 Replies
7. AIX
Dears i have a power7 P770 working in AIX 5.3 TL 11 with frimware AM730_066
is the AM730_066 frimware the latest one or not ? (6 Replies)
Discussion started by: thecobra151
6 Replies
8. Shell Programming and Scripting
I am trying to look into multiple directories and pluck out the latest version of a specific file, regardless of where it sits within the directory structure.
Ex:
The file is a .xls file and could have a depth within the directory of anywhere from 1-5
Working directory - Folder1... (6 Replies)
Discussion started by: co21ss
6 Replies
9. Shell Programming and Scripting
Hi,
I have a file which generate Timestamp in this format :-
20121012162354
20121114191610
20121210232808
20121216220002
20130106220002
20130127220001
20130203220001
20121012162354
20121114191610
20121210232808
20121216220002
20130106220002
20130127220001
20130203220001 (2 Replies)
Discussion started by: netdbaind
2 Replies
10. Shell Programming and Scripting
Hi,
I have a file where versions will be updated, i need to get latest/last updated version from that file. Could you please help?
File looks like below -
<versions>
<version>R20180417.006</version>
<version>R20180421.007</version>
<version>R20180421.008</version>
... (5 Replies)
Discussion started by: schandra128
5 Replies