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