java 执行包含通配符linux命令
package test.runtime;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class RuntimeTest {/** * @param args */public static void main(String[] args) {try {String[] cmd = {"sh","-c", "du -h /opt/apache*"};Process chmodProcess = Runtime.getRuntime().exec(cmd);BufferedReader br = new BufferedReader(new InputStreamReader(chmodProcess.getInputStream()));String line =null;while((line = br.readLine() )!= null) {System.out.println(line);}System.out.println("end");} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}?