[ksh] finding last file with keyword in it

view story

http://www.unix.com – Hi, In short : I have several log files and I need to find the last file with a certain keyword in it. Code: # ls -1tr logs log_hostX.Jan01_0100.gz log_hostX.Jan01_0105.gz log_hostX.Jan01_0110.gz log_hostX.Jan01_0115.gz log_hostX.Jan01_0120.gz log_hostX.Jan01_0125.gz log_hostX.Jan01_0130.gz log_hostX Through Internet I found a way to examine the last, the previous and the previous previous file, but for some reason cannot determine the name of the file before that. My purpose is to find the begin date & time and the end date & time. The end time is always in the las (HowTos)