wie*_*son 5 statistics logging command-line curl file
我正在阅读一个卷曲的流和grep一些亮点.
curl url | grep desired_key_word
Run Code Online (Sandbox Code Playgroud)
我注意到curl为我提供了一些不错的下载统计信息,例如:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.9M 0 10.9M 0 0 1008k 0 --:--:-- 0:00:11 --:--:-- 1092k
Run Code Online (Sandbox Code Playgroud)
如何保存这些统计信息,例如文件中的每秒?
我发现了这个:http://curl.haxx.se/mail/archive-2002-11/0115.html然而它无法将它抽象为我的问题.
curl -n agent.mtconnect.org/sample\?interval=0 -o xml_stream.log 2>> dl.log
Run Code Online (Sandbox Code Playgroud)
dl.log应包含统计信息,但不起作用.
小智 0
只有标准输出会被 -o 标志重定向。
对于 -o 标志,手册页指出:
-o/--output <file>
Write output to <file> instead of stdout...
Run Code Online (Sandbox Code Playgroud)
如果你想要 stderr,你需要这样的东西:
curl -n agent.mtconnect.org/sample\?interval=0 >> xml_stream.log 2>> dl.log
Run Code Online (Sandbox Code Playgroud)