Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 保存并下载统计信息/日志_File_Logging_Curl_Command Line_Statistics - Fatal编程技术网

File 保存并下载统计信息/日志

File 保存并下载统计信息/日志,file,logging,curl,command-line,statistics,File,Logging,Curl,Command Line,Statistics,我在读一条有卷曲和格雷普的流,有一些亮点 curl url | grep desired_key_word 我注意到curl为我提供了一些很好的下载统计数据,例如: % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10.9

我在读一条有卷曲和格雷普的流,有一些亮点

curl url | grep desired_key_word
我注意到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
如何将这些统计数据(例如每秒)保存到文件中

我发现了这一点:但它无法将其抽象为我的问题

curl -n agent.mtconnect.org/sample\?interval=0 -o xml_stream.log 2>> dl.log

dl.log应该包含统计信息,但是它不起作用。

只有标准输出被-o标志重定向

对于-o标志,手册页说明:

-o/--output <file>
          Write output to <file> instead of stdout...

这是未删节的版本


curl-s-s-nhttp://speedtest.fremont.linode.com/100MB-fremont.bin -o/dev/null-w“{time\u total},%%{size\u download},%%{speed\u download}\n”>>stats.log

+1 Wow。这不仅是我要查找的确切命令,也是我希望对其执行下载测试的确切文件。令人毛骨悚然,谢谢!我同样需要检查一个月的网速。
curl -n agent.mtconnect.org/sample\?interval=0 >> xml_stream.log 2>> dl.log