title: Bash - Get files for last 12 hours / sophisticated name format
body: <p>I have a set of logs which have the names as follows:</p>
  
  <blockquote>
    <p>SystemOut_15.07.20_23.00.00.log <br>SystemOut_15.07.21_10.27.17.log <br>
    SystemOut_15.07.21_16.48.29.log <br>SystemOut_15.07.22_15.57.46.log <br>
    SystemOut_15.07.22_13.03.46.log</p>
  </blockquote>
  
  <p>From that list I need to get only files for last 12 hours.
  So as an output I will receive:</p>
  
  <blockquote>
    <p>SystemOut_15.07.22_15.57.46.log<br> SystemOut_15.07.22_13.03.46.log</p>
  </blockquote>
  
  <p>I had similar issue with files having below names but was able to resolve that quickly as the date comes in an easy format:</p>
  
  <blockquote>
    <p>servicemix.log.2015-07-21-11 <br>servicemix.log.2015-07-22-12<br>
    servicemix.log.2015-07-22-13</p>
  </blockquote>
  
  <p>So I created a variable called 'day':</p>
  
  <pre><code>day=$(date -d '-12 hour' +%F-%H)
  </code></pre>
  
  <p>And used below command to get the files for last 12 hours:</p>
  
  <pre><code>ls | awk -F. -v x=$day '$3 &gt;= x'
  </code></pre>
  
  <p>Can you help to have that done with SystemOut files as they have such name syntax containing underscore which confuses me.</p>