get file size of a file to wget before wget-ing it?

前端 未结 2 1490
闹比i
闹比i 2020-12-23 12:25

I\'m wondering if there is a way to check ahead of time the size of a file I might download via wget? I know that using the --spider option tells m

2条回答
  •  渐次进展
    2020-12-23 13:02

    curl --head URL
    

    Look for "Content-Length:" in the output.

    And thanks to Henning Makholm's comment:

    wget --spider URL
    

    and look for "Length:" in the output.

提交回复
热议问题