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 me if a file exists or not, but I'm interested in finding the size of that file as well.
相关问题
- softlinks atime and mtime modification
- Get unexpanded argument from bash command line
- Include and Execute EXE in C# Command Line App
- Batch - Set variables in for loop
- Rails gem update not working (version 4.1.1 to 4.2
相关文章
- Compile and build with single command line Java (L
- How to update command line output?
- How to execute another python script from your scr
- Python file keyword argument?
- Interactively merge files tracked with git and unt
- Lauch default editor (like 'webbrowser' mo
- How to print jq output sequentially
- python using argparse.ArgumentParser method
Hmm.. for me
--spider
does display the size:(But beware that not all web servers will inform clients of the length of the data except by closing the connection when it's all been sent.)
If you're concerned about wget changing the format it reports the length in, you might use
wget --spider --server-response
and look for aContent-Length
header in the output.Look for "Content-Length:" in the output.
And thanks to Henning Makholm's comment:
and look for "Length:" in the output.