title: find and delete zero Byte file in HDFS
body: <p>I need to write a bash script that will help me locate and delete all zero byte files in hdfs .</p>
  
  <p>I tried using this command </p>
  
  <pre><code>hdfs dfs -ls -R / | awk '$1 !~ /^d/ &amp;&amp; $5 == "0" { print $8 }' | xargs -n100 hdfs dfs -rm
  </code></pre>
  
  <p>However, it doesn't locate all the files.</p>
  
  <p>Is there a better way of achieving this.</p>