我正在运行以下命令(在Ubuntu上)
time wget 'http://localhost:8080/upLoading.jsp' --timeout=0
并在命令行中获得结果
real 0m0.042s user 0m0.000s sys 0m0.000s
我尝试过以下操作:
time -a o.txt wget 'http://localhost:8080/upLoading.jsp' --timeout=0
并得到以下错误
-a: command not found
我想把结果重定向到一些文件.我怎样才能做到这一点?
解决方法
您可以使用>>将任何逗号的stdout输出引导到文件.字符.
要将输出附加到文件,请使用>>
请注意,除非明确地完成,输出到stderr将仍然进入控制台.将stderr和stdout引导到相同的输出流使用
command 2>&1 outfile.txt (with bash)
要么
command >& outfile.txt (with t/csh)
如果您正在使用bash All about redirection将为您提供有关重定向的更多细节和控制.