Artifactspublic-v0

curl

master
ply4 git calls156 ms288 KiB2 cachedprotocol v2
90 lines2.8 KiBRaw

--output

Write output to the given file instead of stdout. If you are using globbing in the URL to fetch multiple documents, you should quote the URL and you can use # followed by a number in the filename. That variable gets replaced with the current glob text. Like in:

curl "http://{one,two}.example.com" -o "file_#1.txt"

or use several variables like:

curl "http://{site,host}.host[1-5].example" -o "#1_#2"

You may use this option as many times as the number of URLs you have. For example, if you specify two URLs on the same command line, you can use it like this:

curl -o aa example.com -o bb example.net

and the order of the -o options and the URLs does not matter, only that the first -o is for the first URL and so on, so the above command line can also be written as

curl example.com example.net -o aa -o bb

See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) passes the output to stdout.

To suppress response bodies, you can redirect output to /dev/null:

curl example.com -o /dev/null

Or for Windows:

curl example.com -o nul

Or, even more efficient and portable, use

curl example.com --out-null

Specify the filename as single minus to force the output to stdout, to override curl's internal binary output in terminal prevention:

curl https://example.com/jpeg -o -

Note that the binary output may be caused by the response being compressed, in which case you may want to use the --compressed option.

Since curl 8.21.0, the separate globbing parts can be named and referenced by their names. The case sensitive alphanumeric name is set enclosed within angle brackets after the opening character. Examples:

curl "https://fun.example/{<num>one,two}.jpg" -o "save-#<num>"

curl "ftp://ftp.example/file[<range>1-100].txt" \
  -o "save-#<range>.txt"

Referencing a named glob that is not set, causes an error.

Since curl 8.21.0, you can use parts of the upload filename when it uses globbing by setting a glob name and referencing it the same way you reference named URL globs. For example, if you upload three files to a single fixed HTTP URL and want to save the corresponding responses in separate files:

curl -T 'file{<num>1,2,3}' \
  https://upload.example/ -o 'response-#<num>'
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: output
5Arg: <file>
6Short: o
7Help: Write to file instead of stdout
8Category: important output
9Added: 4.0
10Multi: per-URL
11See-also:
12 - out-null
13 - remote-name
14 - remote-name-all
15 - remote-header-name
16 - compressed
17Example:
18 - -o file $URL
19 - "http://{one,two}.example.com" -o "file_#1.txt"
20 - "http://{site,host}.host[1-5].example" -o "#1_#2"
21 - -o file $URL -o file2 https://example.net
22---
24# `--output`
26Write output to the given file instead of stdout. If you are using globbing in
27the URL to fetch multiple documents, you should quote the URL and you can use
28`#` followed by a number in the filename. That variable gets replaced with the
29current glob text. Like in:
31 curl "http://{one,two}.example.com" -o "file_#1.txt"
33or use several variables like:
35 curl "http://{site,host}.host[1-5].example" -o "#1_#2"
37You may use this option as many times as the number of URLs you have. For
38example, if you specify two URLs on the same command line, you can use it like
39this:
41 curl -o aa example.com -o bb example.net
43and the order of the -o options and the URLs does not matter, only that the
44first -o is for the first URL and so on, so the above command line can also be
45written as
47 curl example.com example.net -o aa -o bb
49See also the --create-dirs option to create the local directories
50dynamically. Specifying the output as '-' (a single dash) passes the output to
51stdout.
53To suppress response bodies, you can redirect output to /dev/null:
55 curl example.com -o /dev/null
57Or for Windows:
59 curl example.com -o nul
61Or, even more efficient and portable, use
63 curl example.com --out-null
65Specify the filename as single minus to force the output to stdout, to
66override curl's internal binary output in terminal prevention:
68 curl https://example.com/jpeg -o -
70Note that the binary output may be caused by the response being compressed, in
71which case you may want to use the --compressed option.
73Since curl 8.21.0, the separate globbing parts can be named and referenced by
74their names. The case sensitive alphanumeric name is set enclosed within angle
75brackets after the opening character. Examples:
77 curl "https://fun.example/{<num>one,two}.jpg" -o "save-#<num>"
79 curl "ftp://ftp.example/file[<range>1-100].txt" \
80 -o "save-#<range>.txt"
82Referencing a named glob that is not set, causes an error.
84Since curl 8.21.0, you can use parts of the upload filename when it uses
85globbing by setting a glob name and referencing it the same way you reference
86named URL globs. For example, if you upload three files to a single fixed HTTP
87URL and want to save the corresponding responses in separate files:
89 curl -T 'file{<num>1,2,3}' \
90 https://upload.example/ -o 'response-#<num>'
Diagnostics4 git calls · 156 ms
CallStatusSizeTime0156 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=1
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=151
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.4 KiB151 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1387
git.response.cache=MISS
git.response.duration_ms=151
git.fetch.wants=b2d196d038dab626646f4f005720fb7c873dfc07
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1387
git.pkt.payload.max=1366
git.sideband.band1.bytes=1365
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e309d838e0ee28
Request
8607e592…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format