Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does curl allow use of the file URL scheme, but not wget

This question refers to curl 7.21.4 and GNU Wget 1.13.4, I don't know if the answer is version specific.

Using the file URI scheme I can get local file using curl as such

$ curl file://localhost/Users/dave/.vimrc
contents of .vimrc

However if I try the same using wget I receive an error:

$ wget file://localhost/Users/dave/.vimrc
file://localhost/Users/dave/.vimrc: Unsupported scheme `file'

Does anyone know why this is the case?

like image 511
davetapley Avatar asked May 04 '12 00:05

davetapley


People also ask

Can I use curl instead of wget?

Are there any difference between curl and wget? Answer: On a high-level, both wget and curl are command line utilities that do the same thing. They both can be used to download files using FTP and HTTP(s). However curl provides APIs that can be used by programmers inside their own code.

What is curl URI?

curl, short for "Client for URLs", is a command line tool for transferring data using various protocols. This tool has applications in many household products such as tablets, printers, cars, routers, etc. There are a vast amount of use-cases for curl, such as: FTP upload. Proxy support.

What is M in curl?

-m, --max-time <seconds> Maximum time in seconds that you allow the whole operation to take.


2 Answers

Because Wget has not been written to support file:// URLs. (It's front web page clearly states "GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP")

Allow me to point to a little curl vs wget comparison.

like image 134
Daniel Stenberg Avatar answered Nov 13 '22 13:11

Daniel Stenberg


wget only supports the HTTP, HTTPS, and FTP protocols.

like image 20
Jon Friskics Avatar answered Nov 13 '22 12:11

Jon Friskics