blob: 4e51b12063a549a81d5323771d1a9fea7a975a32 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: remote-name
4Short: O
5Help: Write output to a file named as the remote file
6Category: important output
7Example: -O https://example.com/filename
8Added: 4.0
9See-also: remote-name-all output-dir remote-header-name
10Multi: append
11---
12Write output to a local file named like the remote file we get. (Only the file
13part of the remote file is used, the path is cut off.)
14
15The file will be saved in the current working directory. If you want the file
16saved in a different directory, make sure you change the current working
17directory before invoking curl with this option or use --output-dir.
18
19The remote file name to use for saving is extracted from the given URL,
20nothing else, and if it already exists it will be overwritten. If you want the
21server to be able to choose the file name refer to --remote-header-name which
22can be used in addition to this option. If the server chooses a file name and
23that name already exists it will not be overwritten.
24
25There is no URL decoding done on the file name. If it has %20 or other URL
26encoded parts of the name, they will end up as-is as file name.
27
28You may use this option as many times as the number of URLs you have.