`curl -O` stores an empty file though `wget` works well
You've missed to follow redirections with curl
as the URL endpoint is redirected (301) to another endpoint (https://s3.amazonaws.com/logzio-elk/apache-daily-access.log
); sending a request with HEAD method (-I
) to the specified URL:
% curl -LI https://logz.io/sample-data
HTTP/1.1 301 Moved Permanently
...
...
Location: https://s3.amazonaws.com/logzio-elk/apache-daily-access.log
...
HTTP/1.1 200 OK
...
...
Server: AmazonS3
As curl
does not follow HTTP redirections by default, you need to tell curl
to do so using the -L
/--location
option:
curl -LO https://logz.io/sample-data
As wget
follows redirections by default, you're getting to the eventual URL with wget
as-is.