Sacar cabeceras HTTP con cURL

Una entrada rápida y concisa para aprender cómo extraer todas las cabeceras de una petición HTTP con cURL. Lo único que hay que hacer es especificar el parámetro -I en la ejecución del comando:

curl -I URL

Ejemplo:

$ curl -I https://google.es
HTTP/2 301 
location: https://www.google.es/
content-type: text/html; charset=UTF-8
date: Sun, 31 May 2020 16:09:12 GMT
expires: Tue, 30 Jun 2020 16:09:12 GMT
cache-control: public, max-age=2592000
server: gws
content-length: 219
x-xss-protection: 0
x-frame-options: SAMEORIGIN
alt-svc: h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

Por supuesto hay otras formas de sacar las cabeceras, incluso con el mismo cURL, pero al pasar el parámetro -I únicamente recibimos por salida estándar la información que necesitamos.