title: How to list only the file names in HDFS
body: <p>I would like to know is there any command/expression to get only the file name in hadoop. I need to fetch only the name of file, when I do <code>hadoop fs -ls</code>  it prints the whole path.</p>
  
  <p>I tried below but just wondering if some better way to do it.</p>
  
  <pre><code>hadoop fs -ls &lt;HDFS_DIR&gt;|cut -d ' ' -f17 
  </code></pre>