curl is a super popular command line tool for downloading files over the network via various network protocols like HTTP or FTP. It also supports submitting GET/POST requests via HTTP, making it very useful for API development and debugging.
curl is based on a
libcurl library, part of the same project, which makes it more suitable for use in programming various applications.
Simply specify a URL and
curl will attempt a download:
In this example, we’re using the
-o (output) option to redirect output (page contents) into
/dev/null - we basically discard the contents as we’re not interested in it just yet.
In this example, we’re using the same
-o option but specify a filename instead of
/dev/null - thus making curl command save the URL content into a file named
If we check now,
/tmp/webpage.html file exists and contains whatever my main webpage did at the time of the download: