#!/bin/bash log_dir="/opt/jgs/log" log_file=$( find "${log_dir}" -name "jgs-2*.log" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" " ) echo "Tailing ${log_file} ..." echo tail -f -n 50 "${log_file}"
[Edit]