blob: 3747845cce23eda612404825a384d785ee8a7756 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001Long: write-out
2Short: w
3Arg: <format>
4Help: Use output FORMAT after completion
5---
6Make curl display information on stdout after a completed transfer. The format
7is a string that may contain plain text mixed with any number of
8variables. The format can be specified as a literal "string", or you can have
9curl read the format from a file with "@filename" and to tell curl to read the
10format from stdin you write "@-".
11
12The variables present in the output format will be substituted by the value or
13text that curl thinks fit, as described below. All variables are specified as
14%{variable_name} and to output a normal % you just write them as %%. You can
15output a newline by using \\n, a carriage return with \\r and a tab space with
16\\t.
17
18.B NOTE:
19The %-symbol is a special symbol in the win32-environment, where all
20occurrences of % must be doubled when using this option.
21
22The variables available are:
23.RS
24.TP 15
25.B content_type
26The Content-Type of the requested document, if there was any.
27.TP
28.B filename_effective
29The ultimate filename that curl writes out to. This is only meaningful if curl
30is told to write to a file with the --remote-name or --output
31option. It's most useful in combination with the --remote-header-name
32option. (Added in 7.26.0)
33.TP
34.B ftp_entry_path
35The initial path curl ended up in when logging on to the remote FTP
36server. (Added in 7.15.4)
37.TP
38.B http_code
39The numerical response code that was found in the last retrieved HTTP(S) or
40FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
41same info.
42.TP
43.B http_connect
44The numerical code that was found in the last response (from a proxy) to a
45curl CONNECT request. (Added in 7.12.4)
46.TP
47.B http_version
48The http version that was effectively used. (Added in 7.50.0)
49.TP
50.B local_ip
51The IP address of the local end of the most recently done connection - can be
52either IPv4 or IPv6 (Added in 7.29.0)
53.TP
54.B local_port
55The local port number of the most recently done connection (Added in 7.29.0)
56.TP
57.B num_connects
58Number of new connects made in the recent transfer. (Added in 7.12.3)
59.TP
60.B num_redirects
61Number of redirects that were followed in the request. (Added in 7.12.3)
62.TP
63.B proxy_ssl_verify_result
64The result of the HTTPS proxy's SSL peer certificate verification that was
65requested. 0 means the verification was successful. (Added in 7.52.0)
66.TP
67.B redirect_url
68When an HTTP request was made without --location to follow redirects (or when
69--max-redir is met), this variable will show the actual URL a redirect
70\fIwould\fP have gone to. (Added in 7.18.2)
71.TP
72.B remote_ip
73The remote IP address of the most recently done connection - can be either
74IPv4 or IPv6 (Added in 7.29.0)
75.TP
76.B remote_port
77The remote port number of the most recently done connection (Added in 7.29.0)
78.TP
79.B scheme
80The URL scheme (sometimes called protocol) that was effectively used (Added in 7.52.0)
81.TP
82.B size_download
83The total amount of bytes that were downloaded.
84.TP
85.B size_header
86The total amount of bytes of the downloaded headers.
87.TP
88.B size_request
89The total amount of bytes that were sent in the HTTP request.
90.TP
91.B size_upload
92The total amount of bytes that were uploaded.
93.TP
94.B speed_download
95The average download speed that curl measured for the complete download. Bytes
96per second.
97.TP
98.B speed_upload
99The average upload speed that curl measured for the complete upload. Bytes per
100second.
101.TP
102.B ssl_verify_result
103The result of the SSL peer certificate verification that was requested. 0
104means the verification was successful. (Added in 7.19.0)
105.TP
106.B time_appconnect
107The time, in seconds, it took from the start until the SSL/SSH/etc
108connect/handshake to the remote host was completed. (Added in 7.19.0)
109.TP
110.B time_connect
111The time, in seconds, it took from the start until the TCP connect to the
112remote host (or proxy) was completed.
113.TP
114.B time_namelookup
115The time, in seconds, it took from the start until the name resolving was
116completed.
117.TP
118.B time_pretransfer
119The time, in seconds, it took from the start until the file transfer was just
120about to begin. This includes all pre-transfer commands and negotiations that
121are specific to the particular protocol(s) involved.
122.TP
123.B time_redirect
124The time, in seconds, it took for all redirection steps including name lookup,
125connect, pretransfer and transfer before the final transaction was
126started. time_redirect shows the complete execution time for multiple
127redirections. (Added in 7.12.3)
128.TP
129.B time_starttransfer
130The time, in seconds, it took from the start until the first byte was just
131about to be transferred. This includes time_pretransfer and also the time the
132server needed to calculate the result.
133.TP
134.B time_total
135The total time, in seconds, that the full operation lasted.
136.TP
137.B url_effective
138The URL that was fetched last. This is most meaningful if you've told curl
139to follow location: headers.
140.RE
141.IP
142If this option is used several times, the last one will be used.