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