url.md (1779B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Long: url 5 Arg: <url/file> 6 Help: URL(s) to work with 7 Category: curl 8 Added: 7.5 9 Multi: append 10 See-also: 11 - next 12 - config 13 - path-as-is 14 - disallow-username-in-url 15 Example: 16 - --url $URL 17 - --url @file 18 --- 19 20 # `--url` 21 22 Specify a URL to fetch or send data to. 23 24 If the given URL is missing a scheme (such as `http://` or `ftp://` etc) curl 25 guesses which scheme to use based on the hostname. If the outermost subdomain 26 name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP case insensitively, then that 27 protocol is used, otherwise it assumes HTTP. Scheme guessing can be avoided by 28 providing a full URL including the scheme, or disabled by setting a default 29 protocol, see --proto-default for details. 30 31 To control where the contents of a retrieved URL is written instead of the 32 default stdout, use the --output or the --remote-name options. When retrieving 33 multiple URLs in a single invoke, each provided URL needs its own dedicated 34 destination option unless --remote-name-all is used. 35 36 On Windows, `file://` accesses can be converted to network accesses by the 37 operating system. 38 39 Starting in curl 8.13.0, curl can be told to download URLs provided in a text 40 file, one URL per line. It is done with `--url @filename`: so instead of a 41 URL, you specify a filename prefixed with the `@` symbol. It can be told to 42 load the list of URLs from stdin by providing an argument like `@-`. 43 44 When downloading URLs given in a file, it implies using --remote-name for each 45 provided URL. The URLs are full, there is no globbing applied or done on 46 these. Features such as --skip-existing work fine in combination with this. 47 48 Lines in the URL file that start with `#` are treated as comments and are 49 skipped.