 <p>You can first delete, then write. </p> <p><code>hadoop fs -rmr &lt;path&gt;</code> removes everything under given path in hdfs including the path itself</p> <p><code>rm -rf &lt;path&gt;</code> removes in local file system. </p> <p>Make sure that there is no other file in the directory.</p>