Unixtrix: dump URL to a local file

curl -O -C - http://wrecking.org/404.jpeg
wget -c http://wrecking.org/404.jpeg

Context:

Someone emailed me a nifty Flash object, and I wanted a copy.

Explanation:

These commands do the same thing: grab the URL indicated and dump it to a local file with the filename used on the remote server. So the URL above becomes 404.jpeg in the local directory. (For curl, this is the -O option.) The other options (-C - and -c, respectively) ensure that if the transfer is interrupted it can be resumed. In both cases, there’s a nice display of progress, etc.

Leave a Reply