• Home
  • Raw
  • Download

Lines Matching +full:basic +full:- +full:ftp

1 <!--
4 SPDX-License-Identifier: curl
5 -->
11 Get the main page from a web-server:
15 Get a README file from an FTP server:
17 curl ftp://ftp.example.com/README
23 Get a directory listing of an FTP site:
25 curl ftp://ftp.example.com/
37 curl ftp://ftp.example.com/ http://www.example.com:8000/
45 curl --ftp-ssl ftp://files.are.example.com/secrets.txt
49 curl -u username sftp://example.com/etc/issue
52 password-protected) to authenticate:
54 curl -u username: --key ~/.ssh/id_rsa scp://example.com/~/file.txt
57 (password-protected) to authenticate:
59 curl -u username: --key ~/.ssh/id_rsa --pass private_key_password
68 curl -u "domain\username:passwd" smb://server.example.com/share/file.txt
74 curl -o thatpage.html http://www.example.com/
79 curl -O http://www.example.com/index.html
83 curl -O www.haxx.se/index.html -O curl.se/download.html
87 ### FTP
89 To ftp files using name and password, include them in the URL like:
91 curl ftp://name:passwd@ftp.server.example:port/full/path/to/file
93 or specify them with the `-u` flag like
95 curl -u name:passwd ftp://ftp.server.example:port/full/path/to/file
99 It is just like for FTP, but you may also want to specify and use SSL-specific
103 standards while the recommended *explicit* way is done by using `FTP://` and
104 the `--ssl-reqd` option.
108 This is similar to FTP, but you can use the `--key` option to specify a
111 remote system; this password is specified using the `--pass` option.
114 matching public key file must be specified using the `--pubkey` option.
125 curl -u name:passwd http://http.server.example/full/path/to/file
128 several: Basic, Digest, NTLM and Negotiate (SPNEGO). Without telling which
129 method to use, curl defaults to Basic. You can also ask curl to pick the most
131 using `--anyauth`.
136 `-u` style for user and password.
145 It does not have special support for FTP proxy servers since there are no
147 can also use both HTTP and SOCKS proxies to transfer files to and from FTP
150 Get an ftp file using an HTTP proxy named my-proxy that uses port 888:
152 curl -x my-proxy:888 ftp://ftp.example.com/README
157 curl -u user:passwd -x my-proxy:888 http://www.example.com/
159 Some proxies require special authentication. Specify by using -U as above:
161 curl -U user:passwd -x my-proxy:888 http://www.example.com/
163 A comma-separated list of hosts and domains which do not use the proxy can be
166 curl --noproxy example.com -x my-proxy:888 http://www.example.com/
168 If the proxy is specified with `--proxy1.0` instead of `--proxy` or `-x`, then
171 curl also supports SOCKS4 and SOCKS5 proxies with `--socks4` and `--socks5`.
176 Most FTP proxy servers are set up to appear as a normal FTP server from the
177 client's perspective, with special commands to select the remote FTP server.
178 curl supports the `-u`, `-Q` and `--ftp-account` options that can be used to
179 set up transfers through many FTP proxies. For example, a file can be uploaded
180 to a remote FTP server using a Blue Coat FTP proxy with the options:
182 curl -u "username@ftp.server.example Proxy-Username:Remote-Pass"
183 --ftp-account Proxy-Password --upload-file local-file
184 ftp://my-ftp.proxy.example:21/remote/upload/path/
186 See the manual for your FTP proxy to determine the form it expects to set up
187 transfers, and curl's `-v` option to see exactly what curl is sending.
191 Get a key file and add it with `apt-key` (when on a system that uses `apt` for
194 curl -L https://apt.example.org/llvm-snapshot.gpg.key | sudo apt-key add -
196 The '|' pipes the output to STDIN. `-` tells `apt-key` that the key file
201 HTTP 1.1 introduced byte-ranges. Using this, a client can request to get only
202 one or more sub-parts of a specified document. Curl supports this with the
203 `-r` flag.
207 curl -r 0-99 http://www.example.com/
211 curl -r -500 http://www.example.com/
213 Curl also supports simple ranges for FTP files as well. Then you can only
216 Get the first 100 bytes of a document using FTP:
218 curl -r 0-99 ftp://www.example.com/README
222 ### FTP / FTPS / SFTP / SCP
226 curl -T - ftp://ftp.example.com/myfile
230 curl -T uploadfile -u user:passwd ftp://ftp.example.com/myfile
235 curl -T uploadfile -u user:passwd ftp://ftp.example.com/
239 curl -T localfile -a ftp://ftp.example.com/remotefile
241 Curl also supports ftp upload through a proxy, but only if the proxy is
245 curl --proxytunnel -x proxy:port -T localfile ftp.example.com
249 curl -T file.txt -u "domain\username:passwd"
256 curl -T - http://www.example.com/myfile
266 if you cannot understand the responses: use the `-v` flag to get verbose
268 let the user see all client-server interaction (but it does not show you the
271 curl -v ftp://ftp.example.com/
274 `--trace` or `--trace-ascii` options with a given filename to log to, like
277 curl --trace trace.txt www.haxx.se
284 a single file, you should use `-I`/`--head` option. It displays all available
285 info on a single file for HTTP and FTP. The HTTP information is a lot more
288 For HTTP, you can get the header information (the same as `-I` would show)
289 shown before the data by using `-i`/`--include`. Curl understands the
290 `-D`/`--dump-header` option when getting files from both FTP and HTTP, and it
295 curl --dump-header headers.txt curl.se
303 It is easy to post data using curl. This is done using the `-d <data>` option.
308 curl -d "name=Rafael%20Sagula&phone=3320780" http://www.example.com/guest.cgi
310 Or automatically [URL encode the data](https://everything.curl.dev/http/post/url-encode).
312 curl --data-urlencode "name=Rafael Sagula&phone=3320780" http://www.example.com/guest.cgi
318 If there is a normal post, you use `-d` to post. `-d` takes a full post
346 curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" http://example.com/post.cgi
348 While `-d` uses the application/x-www-form-urlencoded mime-type, generally
350 multipart/form-data type. This latter type supports things like file upload.
352 `-F` accepts parameters like `-F "name=contents"`. If you want the contents to
359 curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html"
362 If the content-type is not specified, curl tries to guess from the file
365 default type `application/octet-stream`.
367 Emulate a fill-in form with `-F`. Let's say you fill in three fields in a
375 curl -F "file=@cooltext.txt" -F "yourname=Daniel"
376 -F "filedescription=Cool text file with cool text inside"
383 curl -F "pictures=@dog.gif,cat.gif" $URL
387 curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" $URL
390 an embedded `;type=`, use `--form-string` instead of `-F`. This is recommended
392 source. Under these circumstances, using `-F` instead of `--form-string` could
403 curl -e www.example.org http://www.example.com/
414 curl -A 'Mozilla/3.0 (Win95; I)' http://www.bank.example.com/
418 - `Mozilla/3.0 (Win95; I)` - Netscape Version 3 for Windows 95
419 - `Mozilla/3.04 (Win95; U)` - Netscape Version 3 for Windows 95
420 - `Mozilla/2.02 (OS/2; U)` - Netscape Version 2 for OS/2
421 - `Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)` - Netscape for AIX
422 - `Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)` - Netscape for Linux
426 - `Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)` - MSIE for W95
428 Mozilla is not the only possible User-Agent name:
430 - `Konqueror/1.0` - KDE File Manager desktop client
431 - `Lynx/2.7.1 libwww-FM/2.14` - Lynx command line browser
437 headers that looks like `Set-Cookie: <data>` where the data part then
447 Set-Cookie: sessionid=boo123; path="/foo";
455 curl -b "name=Daniel" www.example.com
461 curl --dump-header headers www.example.com
466 curl -b headers.txt www.example.com
469 however error-prone and not the preferred way to do this. Instead, make curl
470 save the incoming cookies using the well-known Netscape cookie format like
473 curl -c cookies.txt www.example.com
475 Note that by specifying `-b` you enable the cookie engine and with `-L` you
478 non-existing file to trigger the cookie awareness like:
480 curl -L -b empty.txt www.example.com
489 To read and write cookies from a Netscape cookie file, you can set both `-b`
490 and `-c` to use the same file:
492 curl -b cookies.txt -c cookies.txt www.example.com
503 From left-to-right:
505 - `%` - percentage completed of the whole transfer
506 - `Total` - total size of the whole expected transfer
507 - `%` - percentage completed of the download
508 - `Received` - currently downloaded amount of bytes
509 - `%` - percentage completed of the upload
510 - `Xferd` - currently uploaded amount of bytes
511 - `Average Speed Dload` - the average transfer speed of the download
512 - `Average Speed Upload` - the average transfer speed of the upload
513 - `Time Total` - expected time to complete the operation
514 - `Time Current` - time passed since the invoke
515 - `Time Left` - expected time left to completion
516 - `Curr.Speed` - the average transfer speed the last 5 seconds (the first
519 The `-#` option displays a totally different progress bar that does not need
525 let the transfer keep going. By using the switch `-y` and `-Y` you can make
532 curl -Y 3000 -y 60 www.far-away.example.com
537 curl -m 1800 -Y 3000 -y 60 www.far-away.example.com
546 curl --limit-rate 10K www.far-away.example.com
550 curl --limit-rate 10240 www.far-away.example.com
554 curl -T upload --limit-rate 1M ftp://uploads.example.com
556 When using the `--limit-rate` option, the transfer rate is regulated on a
557 per-second basis, which causes the total transfer speed to become lower than
570 line is a `#`-symbol the rest of the line is treated as a comment.
581 -m 1800
588 Prevent curl from reading the default file by using -q as the first command
591 curl -q www.example.org
599 You can specify another config file to be read by using the `-K`/`--config`
600 flag. If you set config filename to `-` it reads the config from stdin, which
604 echo "user = user:passwd" | curl -K - http://that.secret.example.com
609 own custom headers when getting a webpage. You can do this by using the `-H`
612 Example, send the header `X-you-and-me: yes` to the server when getting a
615 curl -H "X-you-and-me: yes" love.example.com
618 header than it normally does. The `-H` header you specify then replaces the
623 curl -H "Host:" server.example.com
625 ## FTP and Path Names
627 Do note that when getting files with a `ftp://` URL, the given path is
629 directory at your ftp site, do:
631 curl ftp://user:passwd@my.example.com/README
636 curl ftp://user:passwd@my.example.com//README
646 curl -u $USER sftp://home.example.com/~/.bashrc
648 ## FTP and Firewalls
650 The FTP protocol requires one of the involved parties to open a second
659 curl ftp.example.com
667 The `-P` flag to curl supports a few different options. Your machine may have
668 several IP-addresses and/or network interfaces and curl allows you to select
671 curl -P - ftp.example.com
676 curl -P le0 ftp.example.com
680 curl -P 192.168.0.10 ftp.example.com
686 curl --interface eth0:1 http://www.example.com/
690 curl --interface 192.168.1.10 http://www.example.com/
704 needs to be in PEM-format. PEM is a standard and open format to store
713 curl -E /path/to/cert.pem:password https://secure.example.com/
722 curl --tlv1.0 https://secure.example.com/
729 resume on HTTP(S) downloads as well as FTP uploads and downloads.
733 curl -C - -o file ftp://ftp.example.com/path/file
737 curl -C - -T file ftp://ftp.example.com/path/file
741 curl -C - -o file http://www.example.com/
746 It is `If-Modified-Since` or `If-Unmodified-Since`. curl allows you to specify
747 them with the `-z`/`--time-cond` flag.
752 curl -z local.html http://remote.example.com/remote.html
755 one. Do this by prepending the date string with a `-`, as in:
757 curl -z -local.html http://remote.example.com/remote.html
762 curl -z "Jan 12 2012" http://remote.example.com/remote.html
765 other way around by prepending it with a dash (`-`).
805 curl -B "ldap://ldap.example.com/o=frontec??sub?mail=*sth.example.com"
809 curl -u user:passwd "ldap://ldap.example.com/o=frontec??sub?mail=*"
812 By default, if user and password are provided, OpenLDAP/WinLDAP uses basic
814 `--basic`, `--ntlm` or `--digest` option in curl command line
816 curl --ntlm "ldap://user:passwd@ldap.example.com/o=frontec??sub?mail=*"
818 On Windows, if no user/password specified, auto-negotiation mechanism is used
827 They should be set for protocol-specific proxies. General proxy should be set
832 A comma-separated list of hostnames that should not go through any proxy is
845 The usage of the `-x`/`--proxy` flag overrides the environment variables.
850 to specify name and password for commonly visited FTP sites in a file so that
856 Curl supports `.netrc` files if told to (using the `-n`/`--netrc` and
857 `--netrc-optional` options). This is not restricted to just FTP, so curl can
867 the `-w`/`--write-out` option was introduced. Using this, you can specify what
873 curl -w 'We downloaded %{size_download} bytes\n' www.example.com
875 ## Kerberos FTP Transfer
877 Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need the
880 First, get the krb-ticket the normal way, like with the `kinit`/`kauth` tool.
883 curl --krb private ftp://krb4site.example.com -u username:fakepwd
885 There is no use for a password on the `-u` switch, but a blank one makes curl
890 The curl telnet support is basic and easy to use. Curl passes all data passed
897 to the file you specify with `-o`.
899 You might want the `-N`/`--no-buffer` option to switch off the buffered output
902 Pass options to the telnet protocol negotiation, by using the `-t` option. To
905 curl -tTTYPE=vt100 telnet://remote.example.com
907 Other interesting options for it `-t` include:
909 - `XDISPLOC=<X display>` Sets the X display location.
910 - `NEW_ENV=<var,val>` Sets an environment variable.
939 URL you specify. Note that this also goes for the `-O` option (but not
940 `--remote-name-all`).
942 For example: get two files and use `-O` for the first and a custom file
945 curl -O http://example.com/file.txt ftp://example.com/moo.exe -o moo.jpg
949 curl -T local1 ftp://example.com/moo.exe -T local2 ftp://example.com/moo2.txt
954 and fall back to IPv4 if the connection fails. The `--ipv4` and `--ipv6`
960 When this style is used, the `-g` option must be given to stop curl from
969 IPv6 addresses provided other than in URLs (e.g. to the `--proxy`,
970 `--interface` or `--ftp-port` options) should not be URL encoded.
983 ### `curl-users`
989 ### `curl-library`
993 ### `curl-announce`
995 Low-traffic. Only receives announcements of new public versions. At worst,
999 ### `curl-and-php`
1004 ### `curl-and-python`