I am trying to get the 1st and second to the last line from multiple log files which has varying line numbers. And at the same time showing indicating the log filename before showing the content.Sample file content like below;
Process started
log entries here...
...........
...........
Process successful
Process ended
The desired output I am trying to achieve is like below;
05302016.log
Process started
Process successful
05312016.log
Process started
Process successful
How can this be done using either awk,sed,head,tail or any combination of these commands?