import java.io.*;
public class ExecUnix {
public static void main(String[] args) throws IOException {
for (int i=0; i<10; i++) {
new File("/tmp/file" + i).createNewFile();
}
Runtime.getRuntime().exec("ls -l /tmp/file? > /tmp/data_collect");
Runtime.getRuntime().exec("rm -f /tmp/file?");
}
}
阅读(939) | 评论(0) | 转发(0) |