curl命令的使用说明

find news about what's going on as well as the latest versions
from the curl web pages, located at:  http://curl.haxx.se  
[手册地址]http://curl.haxx.se/docs/manual.html
 
  Get the main page from Netscape's web-server:
 
        curl http://www.netscape.com/
 
  Get the README file the user's home directory at funet's ftp-server:
 
        curl ftp://ftp.funet.fi/README
 
  Get a web page from a server using port 8000:
 
        curl http://www.weirdserver.com:8000/
 
  Get a directory listing of an FTP site:
 
        curl ftp://cool.haxx.se/
 
  Get the definition of curl from a dictionary:
 
        curl dict://dict.org/m:curl
 
  Fetch two documents at once:
 
        curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/
 
  Get a file off an FTPS server:
 
        curl ftps://files.are.secure.com/secrets.txt
 
  or use the more appropriate FTPS way to get the same file:
 
        curl --ftp-ssl ftp://files.are.secure.com/secrets.txt
 
  Get a file from an SSH server using SFTP:
 
        curl -u username sftp://shell.example.com/etc/issue
 
  Get a file from an SSH server using SCP using a private key to authenticate:
 
        curl -u username: --key ~/.ssh/id_dsa --pubkey ~/.ssh/id_dsa.pub \ 
            scp://shell.example.com/~/personal.txt
 
  Get the main page from an IPv6 web server:
 
        curl "http://[2001:1890:1112:1::20]/"
 
DOWNLOAD TO A FILE
 
  Get a web page and store in a local file with a specific name:
 
        curl -o thatpage.html http://www.netscape.com/
 
  Get a web page and store in a local file, make the local file get the name
  of the remote document (if no file name part is specified in the URL, this
  will fail):
 
        curl -O http://www.netscape.com/index.html
 
  Fetch two files and store them with their remote names:
 
        curl -O www.haxx.se/index.html -O curl.haxx.se/download.html
 
USING PASSWORDS
 
 FTP
 
   To ftp files using name+passwd, include them in the URL like:
 
        curl ftp://name:passwd@machine.domain:port/full/path/to/file
 
   or specify them with the -u flag like
 
        curl -u name:passwd ftp://machine.domain:port/full/path/to/file
 
 FTPS
 
   It is just like for FTP, but you may also want to specify and use
   SSL-specific options for certificates etc.
 
   Note that using FTPS:// as prefix is the "implicit" way as described in the
   standards while the recommended "explicit" way is done by using FTP:// and
   the --ftp-ssl option.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值