我想问一下如何保存写入终端的wget或curl输出。 例如:
wget -O - "some file im downloading"
现在终端显示我下载了多少文件,当前下载速度是多少。 所以我想知道如何将所有这些更改值保存到文件
答案 0 :(得分:2)
wget
的状态信息始终打印到stderr(通道2)。因此,您可以将该频道重定向到文件:
wget -O - “某个文件即时下载”> downloaded_file 2> wget_status_info_file
频道1(标准输出)被重定向到文件downloaded_file
,而标准版重定向到wget_status_info_file
。