curl vs wget difference and basic use

curl vs wget

Curl and wget of Linux commands, curl and get have many similarities, such as the following downloads.

To make a difference, curl is better at simulating web requests because it can customize various request parameters. Wget is better at downloading files because it supports ftp.

Definitions of curl and wget

  • Wget – The non-interactive network downloader.

GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.

  • curl – transfer a URL

curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

Use of curl and wget

  • Download File
➜  wget

➜ curl -O 
#O uppercase, no O just print content will not download

➜ curl 

  • Download files and rename
➜  wget -O test-1 
#O uppercase, lowercase O output log

➜ curl -o test-1 
#O lowercase

  • Speed limit Download
➜  wget --limit-rate=50k
➜  curl --limit-rate 50k -O

  • Breakpoint renewal
➜  curl -O -C - 	

#C uppercase, note that the parameter for the resume of 
the breakpoint is -C. To automatically resume the transmission, 
use "-C-", otherwise you need to manually specify the byte 
position of the breakpoint.

➜ wget -c           
#c lowercase
  • Batch download files
➜ curl -O URL1 -O URL2 ...

➜ wget URL1 URL2 ...

More about Linux commands: Linux Commands Tutorial

Add a Comment

Your email address will not be published.