Check tail of multiple files
Presumably
tail log*
is what you’re after. If your tail
doesn’t support multiple arguments, which appears to be the case, you’ll need to loop:
for file in log*; do echo "==> ${file} <=="; tail "${file}"; done
Related videos on Youtube
terdon
Elected moderator on Unix & Linux. I've been using Linux since the late '90s and have gone through a variety of distributions. At one time or another, I've been a user of Mandrake, SuSe, openSuSe, Fedora, RedHat, Ubuntu, Mint, Linux Mint Debian Edition (basically Debian testing but more green) and, for the past few years, Arch. My Linux expertise, such as it is, is mostly on manipulating text and regular expressions since that represents a large chunk of my daily work.
Updated on September 18, 2022Comments
-
terdon almost 2 years
I'm trying to skim through multiple log files to find a specific event that I can't easily grep for. I know which files it could be in and I know what I'm looking for is at the end of the files. What I need is something like this but it's only reading the first file in the string.
tail `ls -x log*`
My bash is a bit rusty but I feel like I'm overlooking something simple. I am using HP-UX.