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 https://www.linuxcommands.site/test

➜ curl -O https://www.linuxcommands.site/test 
#O uppercase, no O just print content will not download

➜ curl  https://www.linuxcommands.site/test 

  • Download files and rename
➜  wget -O test-1 https://www.linuxcommands.site/test 
#O uppercase, lowercase O output log

➜ curl -o test-1 https://www.linuxcommands.site/test 
#O lowercase

  • Speed limit Download
➜  wget --limit-rate=50k https://www.linuxcommands.site/test
➜  curl --limit-rate 50k -O https://www.linuxcommands.site/test

  • Breakpoint renewal
➜  curl -O -C - https://www.linuxcommands.site/test 	

#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 https://www.linuxcommands.site/test           
#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.