जवाबों:
curlनिष्क्रिय HTML आउटपुट कैसे करें-sध्वज का उपयोग करें (मौन संचालन के लिए) और रीडायरेक्ट स्टाउट ( >) से (जैसे) /dev/null(या, यदि आप विंडोज पर हैं, तो बस NUL)
यह, -D <file>(उर्फ --dump-header) के साथ संयोजन आपको वह आउटपुट दे सकता है जिसकी आप तलाश कर रहे हैं।
कर्ल मैनपेज कमांड लाइन विकल्प के बारे में अधिक जानकारी नहीं है जो उपयोगी हो सकता है।
$ curl -s https://superuser.com -D su.txt > /dev/null
$ less -FX su.txt
HTTP/2 200
date: Sun, 25 Feb 2018 17:24:30 GMT
content-type: text/html; charset=utf-8
x-frame-options: SAMEORIGIN
x-request-guid: e147da19-7cc9-42cd-8706-4204fd64d4a9
strict-transport-security: max-age=15552000
content-security-policy-report-only: default-src https: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; report-uri https://stackoverflow.report-uri.io/r/default/csp/reportOnly
accept-ranges: bytes
via: 1.1 varnish
x-served-by: cache-lcy19224-LCY
x-cache: MISS
x-cache-hits: 0
x-timer: S1519579470.439587,VS0,VE88
vary: Fastly-SSL
x-dns-prefetch-control: off
set-cookie: prov=d007391b-afc2-4717-282a-287f18827242; domain=.superuser.com; expires=Fri, 01-Jan-2055 00:00:00 GMT; path=/; HttpOnly
cache-control: private
content-length: 101543
/dev/nullहै बस NUL; मुझे लगता है कि गिट बैश का सम्मान करेंगे, लेकिन मिनट में परीक्षण नहीं कर सकते। मैंने उसे शामिल करने के लिए अपना उत्तर अपडेट कर दिया है।
/dev/nullउस स्थिति में काम कर सकता है!
जब आप कर्ल को स्टडआउट पर डंप करने के लिए कहकर हेडर रखते हैं तो आप शरीर को त्याग सकते हैं:
$ curl -D/dev/stdout -o/dev/null -s https://superuser.com
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
X-Frame-Options: SAMEORIGIN
X-Request-Guid: a599d44b-705c-4615-a8d8-80c7614bd64f
...
-D/dev/stdout: हेडर को मानक आउटपुट पर डंप करें-o/dev/null: शरीर त्यागना-s: प्रगति मीटर को अक्षम करें