Saturday, January 04, 2014

wget vs curl

* wget vs curl

http://curl.haxx.se/latest.cgi?curl=win32-nossl
file: http://mirror.weathercity.com/curl/curl-7.19.5-win32-nossl.zip

- http://curl.haxx.se/latest.cgi?curl=win32-ssl
file: http://mirror.weathercity.com/curl/curl-7.19.5-win32-ssl.zip

** wget
From. http://curl.haxx.se/latest.cgi?curl=win32-nossl
http://www.thegeekstuff.com/2012/07/wget-curl/
http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/
http://www.thegeekstuff.com/2012/04/curl-examples/

Title. wget vs curl: How to Download Files Using wget and curl by Ramesh Natarajan on July 6, 2012

wget http://site/sub/test.bmp

: This is helpful when the remote URL doesn't contain the file name in the url.
wget -O download.zip http://blabla.com/download_script.php?src_id=7701

: Continue the Incomplete Download Using wget -c
$ wget -c http://www.net/s.zip

: FTP download using wget with username and password authentication.
$ wget --ftp-user=USERNAME --ftp-password=PASSWORD DOWNLOAD-URL

** curl
curl http://www.bla.net > test.html

- -o and -O
: -o (lowercase o) result will be saved in the filename provided in the command line
: -O (uppercase O) the filename in the URL will be taken and it will be used as the filename

curle -o test.zip http://test.com/aa.zip

curl -O http://www.aa.net/aa.zip
     -O == --remote-name
curl --remote-name  http://www.aa.net/aa.zip

$ curl -o list.zip http://www.vim.org/scripts/download_script.php?src_id=7701


- downlaod single file with curl
$ curl http://www.centos.org


- Fetch Multiple Files at a time
$ curl -O URL1 -O URL2

- Follow HTTP Location Headers with -L option
$ curl http://www.google.com

: <TITLE>302 Moved</TITLE>
: <H1>302 Moved</H1>
: The document has moved
: <A HREF="http://www.google.co.in/">here</A>

$ curl -L http://www.google.com

- Continue/Resume a Previous Download
  If we say '-C -', then curl will find from where to start resuming
  the download.
$ curl -O http://www.gnu.org/software/gettext/manual/gettext.html

$ curl -C - -O http://www.gnu.org/software/gettext/manual/gettext.html
###############            21.1%


- Pass HTTP Authentication in cURL
$ curl -u username:password URL

- Download Files from FTP server
$ curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/xss.php

$ curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/

$ curl   ftp://ftp.uk.debian.org/debian/pool/main/[a-z]/


- Upload Files to FTP Server
$ curl -u ftpuser:ftppass -T myfile.txt ftp://ftp.testserver.com

- Upload Files - multiple file
$ curl -u ftpuser:ftppass -T "{file1,file2}" ftp://ftp.testserver.com

- More Information using Verbose and Trace Option
curl -v http://google.co.in


- Get Definition of a Word using DICT Protocol
$ curl dict://dict.org/d:bash
$ curl dict://dict.org/show:db
$ curl dict://dict.org/d:bash:foldoc

- Use Proxy to Download a File
$ curl -x proxysever.test.com:3128 http://google.co.in

No comments:

Pranten

 Pranten