📄 curl.1
字号:
If this option is used several times, the last one will be used..IP "-e/--referer <URL>"(HTTP) Sends the "Referer Page" information to the HTTP server. This can alsobe set with the \fI-H/--header\fP flag of course. When used with\fI-L/--location\fP you can append ";auto" to the --referer URL to make curlautomatically set the previous URL when it follows a Location: header. The\&";auto" string can be used alone, even if you don't set an initial --referer.If this option is used several times, the last one will be used..IP "--engine <name>"Select the OpenSSL crypto engine to use for cipheroperations. Use \fI--engine list\fP to print a list of build-time supportedengines. Note that not all (or none) of the engines may be available atrun-time..IP "--environment"(RISC OS ONLY) Sets a range of environment variables, using the names the -woption supports, to easier allow extraction of useful information after havingrun curl.If this option is used several times, each occurrence will toggle this on/off..IP "--egd-file <file>"(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socketis used to seed the random engine for SSL connections. See also the\fI--random-file\fP option..IP "-E/--cert <certificate[:password]>"(SSL) Tells curl to use the specified certificate file when getting a filewith HTTPS or FTPS. The certificate must be in PEM format. If the optionalpassword isn't specified, it will be queried for on the terminal. Note thatthis option assumes a \&"certificate" file that is the private key and theprivate certificate concatenated! See \fI--cert\fP and \fI--key\fP to specifythem independently.If curl is built against the NSS SSL library then this option tellscurl the nickname of the certificate to use within the NSS database definedby the environment variable SSL_DIR (or by default /etc/pki/nssdb). If theNSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may beloaded.If this option is used several times, the last one will be used..IP "--cert-type <type>"(SSL) Tells curl what certificate type the provided certificate is in. PEM,DER and ENG are recognized types. If not specified, PEM is assumed.If this option is used several times, the last one will be used..IP "--cacert <CA certificate>"(SSL) Tells curl to use the specified certificate file to verify thepeer. The file may contain multiple CA certificates. The certificate(s) mustbe in PEM format.curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that isset, and uses the given path as a path to a CA cert bundle. This optionoverrides that variable.The windows version of curl will automatically look for a CA certs file named\'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in theCurrent Working Directory, or in any folder along your PATH.If curl is built against the NSS SSL library then this option tellscurl the nickname of the CA certificate to use within the NSS databasedefined by the environment variable SSL_DIR (or by default /etc/pki/nssdb).If the NSS PEM PKCS#11 module (libnsspem.so) is available then PEM filesmay be loaded.If this option is used several times, the last one will be used..IP "--capath <CA certificate directory>"(SSL) Tells curl to use the specified certificate directory to verify thepeer. The certificates must be in PEM format, and the directory must have beenprocessed using the c_rehash utility supplied with openssl. Using\fI--capath\fP can allow curl to make SSL-connections much more efficientlythan using \fI--cacert\fP if the \fI--cacert\fP file contains many CAcertificates.If this option is used several times, the last one will be used..IP "-f/--fail"(HTTP) Fail silently (no output at all) on server errors. This is mostly donelike this to better enable scripts etc to better deal with failed attempts. Innormal cases when a HTTP server fails to deliver a document, it returns anHTML document stating so (which often also describes why and more). This flagwill prevent curl from outputting that and return error 22.This method is not fail-safe and there are occasions where non-successfulresponse codes will slip through, especially when authentication is involved(response codes 401 and 407).If this option is used twice, the second will again disable silent failure..IP "--ftp-account [data]"(FTP) When an FTP server asks for "account data" after user name and passwordhas been provided, this data is sent off using the ACCT command. (Added in7.13.0)If this option is used twice, the second will override the previous use..IP "--ftp-create-dirs"(FTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist onthe server, the standard behavior of curl is to fail. Using this option, curlwill instead attempt to create missing directories.If this option is used twice, the second will again disable directory creation..IP "--ftp-method [method]"(FTP) Control what method curl should use to reach a file on a FTP(S)server. The method argument should be one of the following alternatives:.RS.IP multicwdcurl does a single CWD operation for each path part in the given URL. For deephierarchies this means very many commands. This is how RFC1738 says it shouldbe done. This is the default but the slowest behavior..IP nocwdcurl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a fullpath to the server for all these commands. This is the fastest behavior..IP singlecwdcurl does one CWD with the full target directory and then operates on the file\&"normally" (like in the multicwd case). This is somewhat more standardscompliant than 'nocwd' but without the full penalty of 'multicwd'..RE.IP "--ftp-pasv"(FTP) Use PASV when transferring. PASV is the internal default behavior, butusing this option can be used to override a previous --ftp-port option. (Addedin 7.11.0)If this option is used several times, the following occurrences make nodifference..IP "--ftp-alternative-to-user <command>"(FTP) If authenticating with the USER and PASS commands fails, send thiscommand. When connecting to Tumbleweed's Secure Transport server over FTPSusing a client certificate, using "SITE AUTH" will tell the server to retrievethe username from the certificate. (Added in 7.15.5).IP "--ftp-skip-pasv-ip"(FTP) Tell curl to not use the IP address the server suggests in its responseto curl's PASV command when curl connects the data connection. Instead curlwill re-use the same IP address it already uses for the controlconnection. (Added in 7.14.2)This option has no effect if PORT, EPRT or EPSV is used instead of PASV.If this option is used twice, the second will again use the server's suggestedaddress..IP "--ftp-ssl"(FTP) Try to use SSL/TLS for the FTP connection. Reverts to a non-secureconnection if the server doesn't support SSL/TLS. See also\fI--ftp-ssl-control\fP and \fI--ftp-ssl-reqd\fP for different levels ofencryption required. (Added in 7.11.0)If this option is used twice, the second will again disable this..IP "--ftp-ssl-control"(FTP) Require SSL/TLS for the ftp login, clear for transfer. Allows secureauthentication, but non-encrypted data transfers for efficiency. Fails thetransfer if the server doesn't support SSL/TLS. (Added in 7.16.0)If this option is used twice, the second will again disable this..IP "--ftp-ssl-reqd"(FTP) Require SSL/TLS for the FTP connection.Terminates the connection if the server doesn't support SSL/TLS.(Added in 7.15.5)If this option is used twice, the second will again disable this..IP "--ftp-ssl-ccc"(FTP) Use CCC (Clear Command Channel)Shuts down the SSL/TLS layer after authenticating. The rest of thecontrol channel communication will be unencrypted. This allowsNAT routers to follow the FTP transaction. The default mode ispassive. See --ftp-ssl-ccc-mode for other modes.(Added in 7.16.1)If this option is used twice, the second will again disable this..IP "--ftp-ssl-ccc-mode [active/passive]"(FTP) Use CCC (Clear Command Channel)Sets the CCC mode. The passive mode will not initiate the shutdown, butinstead wait for the server to do it, and will not reply to theshutdown from the server. The active mode initiates the shutdown andwaits for a reply from the server.(Added in 7.16.2).IP "-F/--form <name=content>"(HTTP) This lets curl emulate a filled in form in which a user has pressed thesubmit button. This causes curl to POST data using the Content-Typemultipart/form-data according to RFC1867. This enables uploading of binaryfiles etc. To force the 'content' part to be a file, prefix the file namewith an @ sign. To just get the content part from a file, prefix the file namewith the letter <. The difference between @ and < is then that @ makes a fileget attached in the post as a file upload, while the < makes a text field andjust get the contents for that text field from a file.Example, to send your password file to the server, where\&'password' is the name of the form-field to which /etc/passwd will be theinput:\fBcurl\fP -F password=@/etc/passwd www.mypasswords.comTo read the file's content from stdin instead of a file, use - where the filename should've been. This goes for both @ and < constructs.You can also tell curl what Content-Type to use by using 'type=', in a mannersimilar to:\fBcurl\fP -F "web=@index.html;type=text/html" url.comor\fBcurl\fP -F "name=daniel;type=text/foo" url.comYou can also explicitly change the name field of an file upload part bysetting filename=, like this:\fBcurl\fP -F "file=@localfile;filename=nameinpost" url.comSee further examples and details in the MANUAL.This option can be used multiple times..IP "--form-string <name=string>"(HTTP) Similar to \fI--form\fP except that the value string for the namedparameter is used literally. Leading \&'@' and \&'<' characters, and the\&';type=' string in the value have no special meaning. Use this in preferenceto \fI--form\fP if there's any possibility that the string value mayaccidentally trigger the \&'@' or \&'<' features of \fI--form\fP..IP "-g/--globoff"This option switches off the "URL globbing parser". When you set this option,you can specify URLs that contain the letters {}[] without having them beinginterpreted by curl itself. Note that these letters are not normal legal URLcontents but they should be encoded according to the URI standard..IP "-G/--get"When used, this option will make all data specified with \fI-d/--data\fP or\fI--data-binary\fP to be used in a HTTP GET request instead of the POSTrequest that otherwise would be used. The data will be appended to the URLwith a '?' separator.If used in combination with -I, the POST data will instead be appended to theURL with a HEAD request.If this option is used several times, the following occurrences make nodifference..IP "-h/--help"Usage help..IP "-H/--header <header>"(HTTP) Extra header to use when getting a web page. You may specify any numberof extra headers. Note that if you should add a custom header that has thesame name as one of the internal ones curl would use, your externally setheader will be used instead of the internal one. This allows you to make eventrickier stuff than curl would normally do. You should not replace internallyset headers without knowing perfectly well what you're doing. Remove aninternal header by giving a replacement without content on the right side ofthe colon, as in: -H \&"Host:".curl will make sure that each header you add/replace get sent with the properend of line marker, you should thus \fBnot\fP add that as a part of the headercontent: do not add newlines or carriage returns they will only mess things upfor you.See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.This option can be used multiple times to add/replace/remove multiple headers..IP "--hostpubmd5"Pass a string containing 32 hexadecimal digits. The string should be the 128bit MD5 cheksum of the remote host's public key, curl will refuse theconnection with the host unless the md5sums match. This option is only for SCPand SFTP transfers. (Added in 7.17.1).IP "--ignore-content-length"(HTTP)Ignore the Content-Length header. This is particularly useful for serversrunning Apache 1.x, which will report incorrect Content-Length for fileslarger than 2 gigabytes..IP "-i/--include"(HTTP)Include the HTTP-header in the output. The HTTP-header includes thingslike server-name, date of the document, HTTP-version and more...If this option is used twice, the second will again disable header include..IP "--interface <name>"Perform an operation using a specified interface. You can enter interfacename, IP address or host name. An example could look like: 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 basically have the same effectas if a new session is started. Typical browsers always discard sessioncookies when they're closed down.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. All SSL connections are attempted to be made secure by usingthe CA certificate bundle installed by default. This makes all connectionsconsidered "insecure" to fail unless \fI-k/--insecure\fP is used.See this online resource for further details:\fBhttp://curl.haxx.se/docs/sslcerts.html\fPIf this option is used twice, the second time will again disable it..IP "--key <key>"(SSL/SSH) Private key file name. Allows you to provide your private key in this
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -