On 03/03/2018 08: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.. thoughts?? find /foo -name "*dog.dat ... tail -5 << obviously not correct. but what would work?
When you have more than one file you can't use "-5", you have to use the full option which is "-n 5". So this should work:
tail -n 5 $(find /foo -name "*dog.dat") _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx