title: How to show only total file size of particular extension in MB GB OR KB in solaris KSH Shell script
body: <p>How to show only total file size of particular extension in MB GB OR KB in sun solaris KSH Shell script I have tried AWK command, below is command:-</p>
  
  <pre><code>BACKUP_SIZE=`find $EXPDP_DIR_PATH -name "DotNet_LI_TRADES_pre_release_*_12092017.log" -exec ls -ltr {} \; | awk ' BEGIN{split("B KB MB GB TB PB EB ZB YB",v)} {s+=$5} {s=1;while($5&gt;1024&amp;&amp;s&lt;9){$5/=1024;s++}  printf "%6.2f %s\n",$5,v[s],$9}'`
  </code></pre>
  
  <p><strong>Output:-</strong></p>
  
  <p>echo $BACKUP_SIZE</p>
  
  <pre><code>681.02 MB 682.54 MB 552.33 MB 1.77 GB 5.92 GB 374.07 MB
  </code></pre>
  
  <p><strong>Desired Output:-</strong></p>
  
  <pre><code>66.87 GB
  </code></pre>