title: View logs from yesterday/today
body: <p>I'm looking for a way to view multiple log files for the last two days into a single pass.</p>
  
  <p>At first, I tried with GREP:</p>
  
  <pre><code>#!/bin/bash
  
  yesterday=$(date --date="yesterday" +"%Y-%m-%d")
  today=$(date +"%Y-%m-%d")
  grep "$yesterday\|$today" *.log | less
  </code></pre>
  
  <p>This is nice but it doesn't output lines in between matches (lines that don't have the date in them, like error stack traces - which is what I'm really interested in)...</p>
  
  <p>So I found this:</p>
  
  <pre><code>#!/bin/bash
  
  yesterday=$(date --date="yesterday" +"%Y-%m-%d")
  sed -ne '/$yesterday/,$p' *.log | less
  </code></pre>
  
  <p>For each file, it outputs everything from the first match to the end of the file.  That's just perfect... except for one thing... When reading it, I don't know which file's content I'm looking at.  I would like to see the file name at the start of each line, just like with a grep.</p>
  
  <ul>
  <li>How can I prefix the file name to each line in my sed command?</li>
  <li>Would there be a nicer / better way to do this?</li>
  </ul>
  
  <p>Thanks ;-)</p>