【发布时间】:2015-10-20 13:48:04
【问题描述】:
所以我有一个curl 格式的请求:
curl -vo /dev/null domain.com/file.jpg
我知道这会执行一个 GET 请求,但是我很难找到 -vo 到底做了什么。
【问题讨论】:
所以我有一个curl 格式的请求:
curl -vo /dev/null domain.com/file.jpg
我知道这会执行一个 GET 请求,但是我很难找到 -vo 到底做了什么。
【问题讨论】:
来自man curl:
-o, --output <file>
Write output to <file> instead of stdout. If you are using {} or [] to fetch
multiple documents, you can use '#' followed by a number in the <file> spec-
ifier. That variable will be replaced with the current string for the URL
being fetched. Like in:
curl http://{one,two}.site.com -o "file_#1.txt"
[...]
-v, --verbose
Be more verbose/talkative during the operation. Useful for debugging and
seeing what's going on "under the hood". A line starting with '>' means
"header data" sent by curl, '<' means "header data" received by curl that is
hidden in normal cases, and a line starting with '*' means additional info
provided by curl.
[...]
【讨论】:
来自man page (man curl):
-o/--输出[文件]
将输出写入 [file] 而不是 stdout。如果您使用 {} 或 [] 来获取多个文档,则可以在 [file] 说明符中使用 '#' 后跟数字。该变量将替换为正在获取的 URL 的当前字符串。像: curl http://{one,two}.site.com -o "file_#1.txt"
或使用几个变量,例如:
curl http://{site,host}.host[1-5].com -o "#1_#2"
您可以根据拥有的 URL 数量多次使用此选项。
-v/--详细
使抓取更加冗长/健谈。主要用于调试。以'>'开头的行表示curl发送的“header data”,'
如果您认为此选项仍然无法提供足够的详细信息,请考虑改用 --trace 或 --trace-ascii。
此选项会覆盖以前使用的 --trace-ascii 或 --trace。
【讨论】: