Run cygwin command from Java and get output



                Process p = Runtime.getRuntime().exec("c:\\cygwin64\\bin\\ls -la");
                
                BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
                String line = null;
                while((line = reader.readLine()) != null){
                    System.out.println(line);
                }