title: awk: Extracting file name from full path
body: <p>I have a listing for a file like this:</p>
  
  <pre><code>-rw-r--r--   3 knsdkls users  336207616 2014-11-10 07:15 /hive/some/thing/path/location/data/plants/zombies/Filename.txt
  </code></pre>
  
  <p>From this, I would like to extract the file size and the filename.</p>
  
  <p>I tried awk: </p>
  
  <pre><code>awk '{print $5,$NF}'
  </code></pre>
  
  <p>Which gives:</p>
  
  <pre><code>336207616  /hive/some/thing/path/location/data/plants/zombies/Filename.txt
  </code></pre>
  
  <p>I would like:</p>
  
  <pre><code>336207616  Filename.txt
  </code></pre>
  
  <p>Please guide me.
  Further, the number of sub-directories in the file path is not constant.</p>
  
  <p>Thanks.</p>