title: Hadoop : Provide directory as input to MapReduce job
body: <p>I'm using Cloudera Hadoop. I'm able to run simple mapreduce program where I provide a file as input to MapReduce program.</p>
  
  <p>This file contains all the other files to be processed by mapper function.</p>
  
  <p>But, I'm stuck at one point.</p>
  
  <pre><code>/folder1
    - file1.txt
    - file2.txt
    - file3.txt
  </code></pre>
  
  <p>How can I specify the input path to MapReduce program as <code>"/folder1"</code>, so that it can start processing each file inside that directory ?</p>
  
  <p>Any ideas ?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>1) Intiailly, I provided the inputFile.txt as input to mapreduce program. It was working perfectly.</p>
  
  <pre><code>&gt;inputFile.txt
  file1.txt
  file2.txt
  file3.txt
  </code></pre>
  
  <p>2) But now, instead of giving an input file, I want to provide with an input directory as arg[0] on command line.</p>
  
  <pre><code>hadoop jar ABC.jar /folder1 /output
  </code></pre>