Would you like to learn how to use the CURL command to get only the headers of the requested URL? In this tutorial, we are going to show you all the steps required to get website headers using the CURL command on a computer running Ubuntu Linux.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18

Tutorial Curl - Get headers only

Use the Curl command to get only the headers of an URL.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, the header got shows that a URL redirect is in place.

Use the following command to force CURL to follow URL redirects.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Optionally, you may save the URL headers to a log file.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Congratulations! You learned how to use the CURL command to get URL headers.

Tutorial Curl - Get HTTPS headers

Use the Curl command to get the headers from an HTTPS URL.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Use the following command to force CURL to include the HTTPS negotiation.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You learned how to use the CURL command to get HTTPS URL headers.