diff options
Diffstat (limited to 'docs/cmdline-opts/output.d')
-rw-r--r-- | docs/cmdline-opts/output.d | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/cmdline-opts/output.d b/docs/cmdline-opts/output.d index bf35bf4a0..15ddd525a 100644 --- a/docs/cmdline-opts/output.d +++ b/docs/cmdline-opts/output.d @@ -4,6 +4,11 @@ Short: o Help: Write to file instead of stdout See-also: remote-name remote-name-all remote-header-name Category: important curl +Example: -o file $URL +Example: "http://{one,two}.example.com" -o "file_#1.txt" +Example: "http://{site,host}.host[1-5].com" -o "#1_#2" +Example: -o file $URL -o file2 https://example.net +Added: 4.0 --- Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you should quote the URL and you can use '#' followed by a @@ -22,7 +27,7 @@ this: curl -o aa example.com -o bb example.net -and the order of the -o options and the URLs doesn't matter, just that the +and the order of the -o options and the URLs does not matter, just that the first -o is for the first URL and so on, so the above command line can also be written as @@ -31,3 +36,11 @@ written as See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout. + +To suppress response bodies, you can redirect output to /dev/null: + + curl example.com -o /dev/null + +Or for Windows use nul: + + curl example.com -o nul |