linux中的find命令:find 文件路径 -name 要查找的文件名字
1 String xml = tmp+".xml"; 2 String[] command = {"find","/media/data/xml","-name", xml}; 3 Process p = Runtime.getRuntime().exec(command); 4 BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); 5 String msg = null; 6 while((msg = br.readLine())!=null){ 7 System.out.println(tmp2+" "+msg); 8 ... 9 } 10 br.close();