Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I know the file size of the downloaded file before downloading it?

share|improve this question
I am not sure can you. Can you give a clearer example? What browser are you using? – slotishtype Jun 6 '11 at 19:27
I think you should at least specify the protocol in your question, because you can download files in many ways: over HTTP, FTP, rsync, scp, bittorrent etc – vtest Jun 6 '11 at 20:13
up vote 4 down vote accepted

You can use the following command:

curl --head <url>

where <url> is the URL of the file you want. The response will be only the headers of the HTTP response, which may include the file size if is known by the server.

share|improve this answer
How does this help with FTP or SCP? – Ignacio Vazquez-Abrams Jun 6 '11 at 19:28
@Ignacio Both of those are used predominately with client programs that commonly provide that information already. HTTP is much more likely. You should probably ask the person asking instead. – Daniel Beck Jun 6 '11 at 19:46
Which may include the file size. If it's something that's being built and streamed on demand, the file size may not be known. – afrazier Jun 6 '11 at 21:51
@afrazier thanks for the correction. – goedson Jun 6 '11 at 23:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.