Dez 20
If you want to download a file with curl type the following code into bash:
1 | curl -O http://www.url.de/file.html |
-O means to output to a file and not to stdout, normally the screen.
What if you need to resume a download of a big file?
1 | curl -C - -O http://www.url.de/file.html |
With -C – you continue downloading the current file. If is important to write -C -. Don’t forget the -
You can also set a referrer and the user agent.
1 | curl -C - -O -A http://www.url.de -e "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" http://www.url.de/file.html |
With -A you can set the referrer and -e sets the user agent.
Pretty helpful.
