0
我想在终端上打印同时或几秒钟后得到wget输出。为了解释我想要看看这个命令wget --recursive --no-clobber --page-requisites --html-extension --convert-links --no-parent http://programmers.blogoverflow.com/
它会下载整个网站,并在执行过程中它会逐步输出它完成的过程,这就是我想要得到的结果。你们知道我该怎么做?如何在终端上打印linux命令的输出?
这是我到目前为止有:
try {
Process processWhoAmI = Runtime.getRuntime().exec("wget --recursive --no-clobber --page-requisites --html-extension --convert-links --no-parent http://programmers.blogoverflow.com/");
} catch (IOException e) {
System.out.println(e);
}
你是从终端执行此操作还是必须从程序中执行此操作?如果来自终端,请查看bash手册页面中的I/O重定向。 –
@JimNutt它必须来自程序内。 :) – Zignd