find /foo -name "*dog.dat" -exec tail -5 {} \;

should work. You could also add various find options like -type f to make sure its a regular file and -mtime n to get recently modified files. 

On Sat, Mar 3, 2018 at 8:15 AM, bruce <> wrote:

Trying to figure out how to do a single line cmd (it should be
possible right??) to do a tail -5 for a list of files???

I thought I could combine find with exec/xargs and tail to generate
the list of files/tail data.. But couldn't figure out the syntax..


find /foo -name "*dog.dat ... tail -5    << obviously not correct. but
what would work?

users mailing list --
To unsubscribe send an email to

OpenStreetMap: Maps with a human touch