title: Order the output of ls command based on the name of the files and in the order they arrived
body: <p>I have a file with below content that is output from a ls -lrt command.
  It's a big file that contains ls -lrt output for few months. </p>
  
  <pre><code>sh&gt;  ls -lrt /vdat/sfrdir/mkbs/daily/2020*/*/*{GNMDCONS,GMFDAILY,GMFDLYMNI,FHLSEC1D,FNMSEC1D,FHLSUP1D,FNMSUP1D,FNMDUSDN,GNMHECD,FNMSEC1M,FHLSEC1M,FHLSEC2M,FHLSEC3M,FHLPSEC4M,FNMSUP1M,FHLSUP1M,FHLSUP2M,FHLSUP3M,FHLPSUP4M,FNMDUSMBS,GNMISS2,G11FCTR,G21FCTR,GNMHECM,GMFMON,GNMMCONS,G12FCTR,G22FCTR,FNMGMEGA,FHLGGNT,GNMPDSCL,FNMDUSDC,FNMDUSMC}.*
  </code></pre>
  
  <p>A file has two parts: a ZIP file and a SIG file. They get downloaded with different time stamps.</p>
  
  <pre><code>sh&gt; head /tmp/jan_files -n14
  -rw-r--r--. 1 ctlr sftg      1541 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg    191881 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg     23185 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDLYMNI.ZIP
  -rw-r--r--. 1 ctlr sftg        30 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDLYMNI.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg      7726 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSEC1D.ZIP.11:39:35
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSEC1D.SIG.11:40:18
  -rw-r--r--. 1 ctlr sftg    185206 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSUP1D.ZIP.11:40:38
  -rw-r--r--. 1 ctlr sftg     11179 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSEC1D.ZIP.11:44:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSEC1D.SIG.11:45:37
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSUP1D.SIG.11:41:21
  -rw-r--r--. 1 ctlr sftg    282086 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSUP1D.ZIP.11:45:59
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSUP1D.SIG.11:46:44
  sh&gt; 
  </code></pre>
  
  <p>I am trying to create an output that pairs the ZIP and SIG file together based on the time they arrived like below. </p>
  
  <pre><code>sh&gt; head /tmp/jan_files -n14
  -rw-r--r--. 1 ctlr sftg      1541 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg    191881 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg     23185 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDLYMNI.ZIP
  -rw-r--r--. 1 ctlr sftg        30 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDLYMNI.SIG
  -rw-r--r--. 1 ctlr sftg      7726 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSEC1D.ZIP.11:39:35
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSEC1D.SIG.11:40:18
  -rw-r--r--. 1 ctlr sftg    185206 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSUP1D.ZIP.11:40:38
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSUP1D.SIG.11:41:21
  -rw-r--r--. 1 ctlr sftg     11179 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSEC1D.ZIP.11:44:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSEC1D.SIG.11:45:37
  -rw-r--r--. 1 ctlr sftg    282086 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSUP1D.ZIP.11:45:59
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSUP1D.SIG.11:46:44
  sh&gt; 
  </code></pre>
  
  <p>I have created the below sort command which is close but its not what I am looking for.</p>
  
  <pre><code>sh&gt; sort -s -k6M -k7n -b -k8.1,8.2 -k9.42,9.43 -k9.51,9.52 /tmp/jan_files | head -n14
  -rw-r--r--. 1 ctlr sftg      1541 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg     23185 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GMFDLYMNI.ZIP
  -rw-r--r--. 1 ctlr sftg    191881 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:23 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg        30 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GMFDLYMNI.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 05:39 /vdat/sfrdir/mkbs/daily/20200102/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg      7726 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSEC1D.ZIP.11:39:35
  -rw-r--r--. 1 ctlr sftg    185206 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FHLSUP1D.ZIP.11:40:38
  -rw-r--r--. 1 ctlr sftg     11179 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSEC1D.ZIP.11:44:54
  -rw-r--r--. 1 ctlr sftg    282086 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Products/FNMSUP1D.ZIP.11:45:59
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:32 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSEC1D.SIG.11:40:18
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FHLSUP1D.SIG.11:41:21
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSEC1D.SIG.11:45:37
  -rw-r--r--. 1 ctlr sftg        29 Jan  2 06:33 /vdat/sfrdir/mkbs/daily/20200102/Signal/FNMSUP1D.SIG.11:46:44
  sh&gt; 
  </code></pre>
  
  <p>Update:</p>
  
  <p>Another case of input files</p>
  
  <pre><code>sh-4.1$ head /tmp/jan_files
  -rw-r--r--. 1 ctlr sftg      2163 Jan  3 05:23 /vdat/sfrdir/mkbs/daily/20200103/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:24 /vdat/sfrdir/mkbs/daily/20200103/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg    239840 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg     13560 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.11:43:28
  -rw-r--r--. 1 ctlr sftg    207324 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.11:44:23
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.11:44:58
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.11:44:04
  -rw-r--r--. 1 ctlr sftg      8525 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.11:38:56
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.11:39:31
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.11:39:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.11:40:25
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.15:39:11
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.15:40:10
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.15:40:47
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.15:39:51
  -rw-r--r--. 1 ctlr sftg     13958 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.15:43:55
  -rw-r--r--. 1 ctlr sftg    212215 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.15:44:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.15:44:32
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.15:45:28
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg     16340 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg    239708 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      2513 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP.20:00:56
  -rw-r--r--. 1 ctlr sftg      5286 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP.20:01:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG.20:02:30
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG.20:01:35
  -rw-r--r--. 1 ctlr sftg      3249 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP
  -rw-r--r--. 1 ctlr sftg      5951 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG
  sh-4.1$ 
  </code></pre>
  
  <p>A vendor creates certain files everyday. Below are the list of files.  {GNMDCONS,GMFDAILY,GMFDLYMNI,FHLSEC1D,FNMSEC1D,FHLSUP1D,FNMSUP1D,FNMDUSDN,GNMHECD,FNMSEC1M,FHLSEC1M,FHLSEC2M,FHLSEC3M,FHLPSEC4M,FNMSUP1M,FHLSUP1M,FHLSUP2M,FHLSUP3M,FHLPSUP4M,FNMDUSMBS,GNMISS2,G11FCTR,G21FCTR,GNMHECM,GMFMON,GNMMCONS,G12FCTR,G22FCTR,FNMGMEGA,FHLGGNT,GNMPDSCL,FNMDUSDC,FNMDUSMC}
  Each file has two parts: a ZIP file and a SIG file. The problem is that they get downloaded with different timestamps. I am trying to pair them together based on the time that they get downloaded. I will then use that list for another operation that will load these file into a database. The load operation requires both the ZIP file and it's associated SIG file. Also, when the same file arrives multiple times a day, it gets renamed with timestamp appended to the file name.</p>
  
  <p>I am looking for output something like this. </p>
  
  <pre><code>-rw-r--r--. 1 ctlr sftg      2163 Jan  3 05:23 /vdat/sfrdir/mkbs/daily/20200103/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:24 /vdat/sfrdir/mkbs/daily/20200103/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg    239840 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg      8525 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.11:38:56
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.11:39:31
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.11:39:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.11:40:25
  -rw-r--r--. 1 ctlr sftg     13560 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.11:43:28
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.11:44:04
  -rw-r--r--. 1 ctlr sftg    207324 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.11:44:23
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.11:44:58
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.15:39:11
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.15:39:51
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.15:40:10
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.15:40:47
  -rw-r--r--. 1 ctlr sftg     13958 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.15:43:55
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.15:44:32
  -rw-r--r--. 1 ctlr sftg    212215 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.15:44:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.15:45:28
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg     16340 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg    239708 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      2513 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP.20:00:56
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG.20:01:35
  -rw-r--r--. 1 ctlr sftg      5286 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP.20:01:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG.20:02:30
  -rw-r--r--. 1 ctlr sftg      3249 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG
  -rw-r--r--. 1 ctlr sftg      5951 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG
  </code></pre>
  
  <p>This is what my sort outputs</p>
  
  <pre><code>sh-4.1$ sort -s -k6M -k7n -b -k8.1,8.2 -k9.42,9.43 -k9.51,9.52 /tmp/jan_files
  -rw-r--r--. 1 ctlr sftg      2163 Jan  3 05:23 /vdat/sfrdir/mkbs/daily/20200103/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg    239840 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:24 /vdat/sfrdir/mkbs/daily/20200103/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg      8525 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.11:38:56
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.11:39:50
  -rw-r--r--. 1 ctlr sftg     13560 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.11:43:28
  -rw-r--r--. 1 ctlr sftg    207324 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.11:44:23
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.11:39:31
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.11:40:25
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.11:44:58
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.11:44:04
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.15:39:11
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.15:40:10
  -rw-r--r--. 1 ctlr sftg     13958 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.15:43:55
  -rw-r--r--. 1 ctlr sftg    212215 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.15:44:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.15:40:47
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.15:39:51
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.15:44:32
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.15:45:28
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg     16340 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg    239708 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg      2513 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP.20:00:56
  -rw-r--r--. 1 ctlr sftg      5286 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP.20:01:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG.20:02:30
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG.20:01:35
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      3249 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP
  -rw-r--r--. 1 ctlr sftg      5951 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG
  sh-4.1$ 
  </code></pre>
  
  <p>And this is what your solution outputs</p>
  
  <pre><code>sh-4.1$ awk  -F"[/.]" '{print $2,$9,$8" |"$0}' /tmp/jan_files | \
  &gt; sort -k5,5M -k6,6n -k7,7 -k8,9                   | \
  &gt; awk  -F"|" '{print $2}'
  -rw-r--r--. 1 ctlr sftg      2163 Jan  3 05:23 /vdat/sfrdir/mkbs/daily/20200103/Products/GMFDAILY.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:24 /vdat/sfrdir/mkbs/daily/20200103/Signal/GMFDAILY.SIG
  -rw-r--r--. 1 ctlr sftg    239840 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Products/GNMDCONS.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 05:34 /vdat/sfrdir/mkbs/daily/20200103/Signal/GNMDCONS.SIG
  -rw-r--r--. 1 ctlr sftg     13560 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.11:43:28
  -rw-r--r--. 1 ctlr sftg    207324 Jan  3 06:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.11:44:23
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.11:44:04
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.11:44:58
  -rw-r--r--. 1 ctlr sftg      8525 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.11:38:56
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.11:39:31
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.11:39:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 06:33 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.11:40:25
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP.15:39:11
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 11:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP.15:40:10
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG.15:39:51
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG.15:40:47
  -rw-r--r--. 1 ctlr sftg     13958 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP.15:43:55
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG.15:44:32
  -rw-r--r--. 1 ctlr sftg    212215 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP.15:44:50
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 11:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG.15:45:28
  -rw-r--r--. 1 ctlr sftg    174536 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg     16340 Jan  3 15:30 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg      8537 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Products/FHLSEC1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FHLSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:31 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSEC1D.SIG
  -rw-r--r--. 1 ctlr sftg    239708 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMSUP1D.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:32 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMSUP1D.SIG
  -rw-r--r--. 1 ctlr sftg      2513 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP.20:00:56
  -rw-r--r--. 1 ctlr sftg      5286 Jan  3 15:55 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP.20:01:54
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG.20:01:35
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 15:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG.20:02:30
  -rw-r--r--. 1 ctlr sftg      3249 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSDN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSDN.SIG
  -rw-r--r--. 1 ctlr sftg      5951 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Products/FNMDUSMN.ZIP
  -rw-r--r--. 1 ctlr sftg        29 Jan  3 19:56 /vdat/sfrdir/mkbs/daily/20200103/Signal/FNMDUSMN.SIG
  sh-4.1$ 
  </code></pre>