📄 curl.1
字号:
.B "curl --interface eth0:1 http://www.netscape.com/"If this option is used several times, the last one will be used..IP "-I/--head"(HTTP/FTP/FILE)Fetch the HTTP-header only! HTTP-servers feature the command HEADwhich this uses to get nothing but the header of a document. When usedon a FTP or FILE file, curl displays the file size and last modificationtime only.If this option is used twice, the second will again disable header only..IP "-j/--junk-session-cookies"(HTTP) When curl is told to read cookies from a given file, this option willmake it discard all "session cookies". This will basicly have the same effectas if a new session is started. Typical browsers always discard sessioncookies when they're closed down. (Added in 7.9.7)If this option is used several times, each occurrence will toggle this on/off..IP "-k/--insecure"(SSL) This option explicitly allows curl to perform "insecure" SSL connectionsand transfers. Starting with curl 7.10, all SSL connections will be attemptedto be made secure by using the CA certificate bundle installed bydefault. This makes all connections considered "insecure" to fail unless-k/--insecure is used.This option is ignored if --cacert or --capath is used!If this option is used twice, the second time will again disable it..IP "--krb4 <level>"(FTP) Enable kerberos4 authentication and use. The level must be entered andshould be one of 'clear', 'safe', 'confidential' or 'private'. Should you usea level that is not one of these, 'private' will instead be used.If this option is used several times, the last one will be used..IP "-K/--config <config file>"Specify which config file to read curl arguments from. The config file is atext file in which command line arguments can be written which then will beused as if they were written on the actual command line. Options and theirparameters must be specified on the same config file line. If the parameter isto contain white spaces, the parameter must be inclosed within quotes. If thefirst column of a config line is a '#' character, the rest of the line will betreated as a comment.Specify the filename as '-' to make curl read the file from stdin.Note that to be able to specify a URL in the config file, you need to specifyit using the --url option, and not by simply writing the URL on its ownline. So, it could look similar to this:url = "http://curl.haxx.se/docs/"This option can be used multiple times..IP "--limit-rate <speed>"Specify the maximum transfer rate you want curl to use. This feature is usefulif you have a limited pipe and you'd like your transfer not use your entirebandwidth.The given speed is measured in bytes/second, unless a suffix isappended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M'makes it megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and1G.This option was introduced in curl 7.10.If this option is used several times, the last one will be used..IP "-l/--list-only"(FTP)When listing an FTP directory, this switch forces a name-only view.Especially useful if you want to machine-parse the contents of an FTPdirectory since the normal directory view doesn't use a standard lookor format.This option causes an FTP NLST command to be sent. Some FTP serverslist only files in their response to NLST; they do not includesubdirectories and symbolic links.If this option is used twice, the second will again disable list only..IP "-L/--location"(HTTP/HTTPS) If the server reports that the requested page has a differentlocation (indicated with the header line Location:) this flag will let curlattempt to reattempt the get on the new place. If used together with -i or -I,headers from all requested pages will be shown. If authentication is used,curl will only send its credentials to the initial host, so if a redirecttakes curl to a different host, it won't intercept the user+password. See also\fI--location-trusted\fP on how to change this.If this option is used twice, the second will again disable location following..IP "--location-trusted"(HTTP/HTTPS) Like \fI--location\fP, but will allow sending the name + passwordto all hosts that the site may redirect to. This may or may not introduce asecurity breach if the site redirects you do a site to which you'll send yourauthentication info (which is plaintext in the case of HTTP Basicauthentication).If this option is used twice, the second will again disable location following..IP "--max-filesize <bytes>"Specify the maximum size (in bytes) of a file to download. If the filerequested is larger than this value, the transfer will not start and curl willreturn with exit code 63.NOTE: The file size is not always known prior to download, and for such filesthis option has no effect even if the file transfer ends up being larger thanthis given limit. This concerns both FTP and HTTP transfers..IP "-m/--max-time <seconds>"Maximum time in seconds that you allow the whole operation to take. This isuseful for preventing your batch jobs from hanging for hours due to slownetworks or links going down. This doesn't work fully in win32 systems. Seealso the \fI--connect-timeout\fP option.If this option is used several times, the last one will be used..IP "-M/--manual"Manual. Display the huge help text..IP "-n/--netrc"Makes curl scan the.I .netrcfile in the user's home directory for login name and password. This istypically used for ftp on unix. If used with http, curl will enable userauthentication. See.BR netrc(4)or.BR ftp(1)for details on the file format. Curl will not complain if that filehasn't the right permissions (it should not be world nor groupreadable). The environment variable "HOME" is used to find the homedirectory.A quick and very simple example of how to setup a.I .netrcto allow curl to ftp to the machine host.domain.com with user name\&'myself' and password 'secret' should look similar to:.B "machine host.domain.com login myself password secret"If this option is used twice, the second will again disable netrc usage..IP "--negotiate"(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method wasdesigned by Microsoft and is used in their web aplications. It is primarilymeant as a support for Kerberos5 authentication but may be also used alongwith another authentication methods. For more information see IETF draftdraft-brezak-spnego-http-04.txt. (Added in 7.10.6)\fBNOTE\fP that this option requiures that the library was built with GSSAPIsupport. This is not very common. Use \fIcurl --version\fP to see if yourversion supports GSS-Negotiate.If this option is used several times, the following occurrences make nodifference..IP "-N/--no-buffer"Disables the buffering of the output stream. In normal work situations, curlwill use a standard buffered output stream that will have the effect that itwill output the data in chunks, not necessarily exactly when the data arrives.Using this option will disable that buffering.If this option is used twice, the second will again switch on buffering..IP "--ntlm"(HTTP) Enables NTLM authentication. The NTLM authentication method wasdesigned by Microsoft and is used by IIS web servers. It is a proprietaryprotocol, reversed engineered by clever people and implemented in curl basedon their efforts. This kind of behavior should not be endorsed, you shouldencourage everyone who uses NTLM to switch to a public and documentedauthentication method instead. Such as Digest. (Added in 7.10.6)\fBNOTE\fP that this option requiures that the library was built with SSLsupport. Use \fIcurl --version\fP to see if your version supports NTLM.If this option is used several times, the following occurrences make nodifference..IP "-o/--output <file>"Write output to <file> instead of stdout. If you are using {} or [] to fetchmultiple documents, you can use '#' followed by a number in the <file>specifier. That variable will be replaced with the current string for the URLbeing fetched. Like in: curl http://{one,two}.site.com -o "file_#1.txt"or use several variables like: curl http://{site,host}.host[1-5].com -o "#1_#2"You may use this option as many times as you have number of URLs.See also the --create-dirs option to create the local directories dynamically..IP "-O/--remote-name"Write output to a local file named like the remote file we get. (Only the filepart of the remote file is used, the path is cut off.)You may use this option as many times as you have number of URLs..IP "-p/--proxytunnel"When an HTTP proxy is used, this option will cause non-HTTP protocols toattempt to tunnel through the proxy instead of merely using it to do HTTP-likeoperations. The tunnel approach is made with the HTTP proxy CONNECT requestand requires that the proxy allows direct connect to the remote port numbercurl wants to tunnel through to.If this option is used twice, the second will again disable proxy tunnel..IP "-P/--ftpport <address>"(FTP)Reverses the initiator/listener roles when connecting with ftp. Thisswitch makes Curl use the PORT command instead of PASV. Inpractice, PORT tells the server to connect to the client's specifiedaddress and port, while PASV asks the server for an ip address andport to connect to. <address> should be one of:.RS.TP 12.B interfacei.e "eth0" to specify which interface's IP address you want to use (Unix only).TP.B "IP address"i.e "192.168.10.1" to specify exact IP number.TP.B "host name"i.e "my.host.domain" to specify machine.TP.B "-"(any single-letter string) to make it pick the machine's default.REIf this option is used several times, the last one will be used..IP "-q"If used as the first parameter on the command line, the.I $HOME/.curlrcfile will not be read and used as a config file..IP "-Q/--quote <comand>"(FTP) Send an arbitrary command to the remote FTP server, by using the QUOTEcommand of the server. Not all servers support this command, and the set ofQUOTE commands are server specific! Quote commands are sent BEFORE thetransfer is taking place. To make commands take place after a successfultransfer, prefix them with a dash '-'. You may specify any amount of commandsto be run before and after the transfer. If the server returns failure for oneof the commands, the entire operation will be aborted.This option can be used multiple times..IP "--random-file <file>"(HTTPS) Specify the path name to file containing what will be considered asrandom data. The data is used to seed the random engine for SSL connections.See also the.I "--edg-file"option..IP "-r/--range <range>"(HTTP/FTP)Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTPserver. Ranges can be specified in a number of ways..RS.TP 10.B 0-499specifies the first 500 bytes.TP.B 500-999specifies the second 500 bytes.TP.B -500specifies the last 500 bytes.TP.B 9500specifies the bytes from offset 9500 and forward.TP.B 0-0,-1specifies the first and last byte only(*)(H).TP.B 500-700,600-799specifies 300 bytes from offset 500(H).TP.B 100-199,500-599specifies two separate 100 bytes ranges(*)(H).RE(*) = NOTE that this will cause the server to reply with a multipartresponse!You should also be aware that many HTTP/1.1 servers do not have this featureenabled, so that when you attempt to get a range, you'll instead get the wholedocument.FTP range downloads only support the simple syntax 'start-stop' (optionallywith one of the numbers omitted). It depends on the non-RFC command SIZE.If this option is used several times, the last one will be used..IP "-R/--remote-time"When used, this will make libcurl attempt to figure out the timestamp of theremote file, and if that is available make the local file get that sametimestamp.If this option is used twice, the second time disables this again..IP "-s/--silent"Silent mode. Don't show progress meter or error messages. MakesCurl mute.If this option is used twice, the second will again disable mute..IP "-S/--show-error"When used with -s it makes curl show error message if it fails.If this option is used twice, the second will again disable show error..IP "--stderr <file>"Redirect all writes to stderr to the specified file instead. If the file nameis a plain '-', it is instead written to stdout. This option has no point whenyou're using a shell with decent redirecting capabilities.If this option is used several times, the last one will be used..IP "-t/--telnet-option <OPT=val>"Pass options to the telnet protocol. Supported options are:TTYPE=<term> Sets the terminal type.XDISPLOC=<X display> Sets the X display location.NEW_ENV=<var,val> Sets an environment variable..IP "-T/--upload-file <file>"This transfers the specified local file to the remote URL. If there is no filepart in the specified URL, Curl will append the local file name. NOTE that youmust use a trailing / on the last directory to really prove to Curl that thereis no file name or curl will think that your last directory name is the remotefile name to use. That will most likely cause the upload operation to fail. Ifthis is used on a http(s) server, the PUT command will be used.Use the file name "-" (a single dash) to use stdin instead of a given file.Before 7.10.8, when this option was used several times, the last one was used.In curl 7.10.8 and later, you can specify one -T for each URL on the commandline. Each -T + URL pair specifies what to upload and to where. curl alsosupports "globbing" of the -T argument, meaning that you can upload multiplefiles to a single URL by using the same URL globbing style supported in theURL, like this:curl -T "{file1,file2}" http://www.uploadtothissite.comor evencurl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/.IP "--trace <file>"Enables a full trace dump of all incoming and outgoing data, includingdescriptive information, to the given output file. Use "-" as filename to havethe output sent to stdout.If this option is used several times, the last one will be used. (Added in7.9.7).IP "--trace-ascii <file>"Enables a full trace dump of all incoming and outgoing data, includingdescriptive information, to the given output file. Use "-" as filename to havethe output sent to stdout.This is very similar to --trace, but leaves out the hex part and only showsthe ASCII part of the dump. It makes smaller output that might be easier toread for untrained humans.If this option is used several times, the last one will be used. (Added in7.9.7).IP "-u/--user <user:password>"Specify user and password to use when fetching. Read the MANUAL for detailedexamples of how to use this. If no password is specified, curl will ask for itinteractively.You can also use the --digest option to enable Digest authentication whencommunicating with HTTP 1.1 servers.If this option is used several times, the last one will be used..IP "-U/--proxy-user <user:password>"Specify user and password to use for Proxy authentication. If nopassword is specified, curl will ask for it interactively.If this option is used several times, the last one will be used..IP "--url <URL>"Specify a URL to fetch. This option is mostly handy when you want to specify
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -