Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Is there a unix command I can use to pull a file from a URL and put it into a directory of my choice? So I have a URL which if you go to it, a file will be downloaded. I want to be able to type a unix command to download the linked file from the URL I specify and place it into a directory of my choice.

So if the URL I want to type a unix command to download the image.png file, I want to put that file into my examples/ directory

Is this possible?


share|improve this question

migrated from Jun 14 '11 at 23:25

This question came from our site for professional and enthusiast programmers.

I've tried curl and wget as suggested; however, I do not believe the file is finishing downloading. The file I am attempting to download is a .apk (android app) Thanks for all suggestions so far – Corey Jun 14 '11 at 21:37
Both curl and wget provide progress indication for downloads. – Brandon E Taylor Jun 14 '11 at 21:49
Yes they do and they say 100%; however, I don't think it is correct. try for yourself. I am using the following URL to test:‌​er_2.5.2.apk First try with both curl and wget then go to the URL directly and compare the results – Corey Jun 14 '11 at 21:51
And I've also got an error when trying wget Connecting to||:80... connected. HTTP request sent, awaiting response... No data received. Retrying. – Corey Jun 14 '11 at 21:55
I suspect the freewarelovers site has set things up such that you cannot directly download the resource using the URL you provided. – Brandon E Taylor Jun 14 '11 at 22:02
wget -P examples/


curl -o examples/image.png

both work.

share|improve this answer

Meet your new friend, wget:

wget -O examples/image.png


man wget

for more usage details.

share|improve this answer

You must log in to answer this question.