Purpose: to download files via http, ftp, etc., or upload files and similar wget
1. Examples of network test
Curl can query parameters by using specific parameters man
1
|
[root@localhost ~]# man curl
|
-a/--append | When uploading files, append to the destination file |
-A/--user-agent <string> | Set the user agent to the server |
-anyauth | You can use "any" authentication method |
-b/--cookie <name=string/file> | cookie string or file reading position |
--basic | Use HTTP Basic Authentication |
-B/--use-ascii | Use ASCII / Text Transfer |
-c/--cookie-jar <file> | After the operation the cookie is written to the file |
-C/--continue-at <offset> | Resume turn |
-d/--data <data> | HTTP POST data transfer mode |
--data-ascii <data> | Ascii way to post data |
--data-binary <data> | Post data in a binary way |
--negotiate | Use HTTP Authentication |
--digest | Using digital authentication |
--disable-eprt | EPRT prohibit the use or LPRT |
--disable-epsv | Prohibit the use EPSV |
-D/--dump-header <file> | The header information is written to the file |
--egd-file <file> | EGD socket provided random data path (SSL) |
--tcp-nodelay | Use TCP_NODELAY option |
-e/--referer | Source URL |
-E/--cert <cert[:passwd]> | The client certificate file and password (SSL) |
--cert-type <type> | File Type Certificate (DER / PEM / ENG) (SSL) |
--key <key> | Private key file name (SSL) |
--key-type <type> | Private key file type (DER / PEM / ENG) (SSL) |
--pass <pass> | Private key cryptography (SSL) |
--engine <eng> | Encryption engine uses (SSL). "--Engine list" for list |
--cacert <file> | CA certificate (SSL) |
--capath <directory> | CA目录 (made using c_rehash) to verify peer against (SSL) |
--ciphers <list> | SSL password |
--compressed | Asked to return a compressed situation (a using the deflate or gzip ) |
--connect-timeout <seconds> | Set the maximum request time |
--create-dirs | Local directory directory hierarchy |
--crlf | Upload the LF is converted to CRLF |
-f/--fail | Http error is not displayed when the connection fails |
--ftp-create-dirs | If the remote directory does not exist, create a remote directory |
--ftp-method [multicwd/nocwd/singlecwd] | Control the use of CWD |
--ftp-pasv | 使用 PASV/EPSV 代替端口 |
--ftp-skip-pasv-ip | 使用PASV的时候,忽略该IP地址 |
--ftp-ssl | 尝试用 SSL/TLS 来进行ftp数据传输 |
--ftp-ssl-reqd | 要求用 SSL/TLS 来进行ftp数据传输 |
-F/--form <name=content> | 模拟http表单提交数据 |
--form-string <name=string> | 模拟http表单提交数据 |
-g/--globoff | 禁用网址序列和范围使用{}和[] |
-G/--get | 以get的方式来发送数据 |
-H/--header <line> | 自定义头信息传递给服务器 |
--ignore-content-length | 忽略的HTTP头信息的长度 |
-i/--include | 输出时包括protocol头信息 |
-I/--head | 只显示请求头信息 |
-j/--junk-session-cookies | 读取文件进忽略session cookie |
--interface <interface> | 使用指定网络接口/地址 |
--krb4 <level> | 使用指定安全级别的krb4 |
-k/--insecure | 允许不使用证书到SSL站点 |
-K/--config | 指定的配置文件读取 |
-l/--list-only | 列出ftp目录下的文件名称 |
--limit-rate <rate> | 设置传输速度 |
--local-port<NUM> | 强制使用本地端口号 |
-m/--max-time <seconds> | 设置最大传输时间 |
--max-redirs <num> | 设置最大读取的目录数 |
--max-filesize <bytes> | 设置最大下载的文件总量 |
-M/--manual | 显示全手动 |
-n/--netrc | 从netrc文件中读取用户名和密码 |
--netrc-optional | 使用 .netrc 或者 URL来覆盖-n |
--ntlm | 使用 HTTP NTLM 身份验证 |
-N/--no-buffer | 禁用缓冲输出 |
-o/--output | 把输出写到该文件中 |
-O/--remote-name | 把输出写到该文件中,保留远程文件的文件名 |
-p/--proxytunnel | 使用HTTP代理 |
--proxy-anyauth | 选择任一代理身份验证方法 |
--proxy-basic | 在代理上使用基本身份验证 |
--proxy-digest | 在代理上使用数字身份验证 |
--proxy-ntlm | 在代理上使用ntlm身份验证 |
-P/--ftp-port <address> | 使用端口地址,而不是使用PASV |
-q | 作为第一个参数,关闭 .curlrc |
-Q/--quote <cmd> | 文件传输前,发送命令到服务器 |
-r/--range <range> | 检索来自HTTP/1.1或FTP服务器字节范围 |
--range-file | 读取(SSL)的随机文件 |
-R/--remote-time | 在本地生成文件时,保留远程文件时间 |
--retry <num> | 传输出现问题时,重试的次数 |
--retry-delay <seconds> | 传输出现问题时,设置重试间隔时间 |
--retry-max-time <seconds> | 传输出现问题时,设置最大重试时间 |
-s/--silent | 静默模式。不输出任何东西 |
-S/--show-error | 显示错误 |
--socks4 <host[:port]> | 用socks4代理给定主机和端口 |
--socks5 <host[:port]> | 用socks5代理给定主机和端口 |
--stderr <file> | |
-t/--telnet-option <OPT=val> | Telnet option settings |
--trace <file> | The specified file debug |
--trace-ascii <file> | Like - but no trace hex output |
--trace-time | Tracking / verbose output, add a timestamp |
-T/--upload-file <file> | upload files |
--url <URL> | Spet URL to work with |
-u/--user <user[:password]> | Set the server's user and password |
-U/--proxy-user <user[:password]> | Set proxy username and password |
-w/--write-out [format] | What output is completed |
-x/--proxy <host[:port]> | HTTP proxy on the given port |
-X/--request <command> | What command specified |
-y/--speed-time | Abandon the speed limit in the time required, the default is 30 |
-Y/--speed-limit |