且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

java的执行linux命令

更新时间:2023-12-03 23:28:04

您可以把所有的文件目录下,成为一个收集和遍历它:

You could put all files under the dir into a collection and iterate over it:

File[] files = dir.listFiles();
for (File f : files) {
  Runtime.getRuntime().exec("cat "+dir.getAbsolutePath()+File.separator+f.getName());
}