title: count lines with wc command from java issue
body: <p>I want to count the lines of file using java and the code that i use is:</p>
  
  <pre><code>String[] wcCommand = new String[]{"/usr/bin/wc","-l" , filePath};
  Process wcProcess=Runtime.getRuntime().exec(wcCommand);
  wcProcess.waitFor();
  BufferedReader bufferedReader = new BufferedReader(new InputStreamReader( wcProcess.getInputStream()));
  String numberOfRowsline;
  while((numberOfRowsline = bufferedReader.readLine()) != null) {
        System.out.print(numberOfRowsline);
  }
  </code></pre>
  
  <p>If i have large file with 5000000 rows then the command returns  wrong number. Why this happens? When i execute the command direct from the terminal the returned value is correct.</p>
  
  <p>The output from java is: 3288079 /PathToFile</p>
  
  <p>The output from terminal: 5000000 /PathToFile</p>