curl的ftp功能也不错
来源:互联网 发布:particle fever 知乎 编辑:程序博客网 时间:2024/04/30 07:24
Lets look at how we can do it with curl.
The simplest way to access a ftp server with username and password
curl ftp://myftpsite.com --user myname:mypassword
With the command line above, curl will try to connect to the ftp server and list all the directories and files in the ftp home directory.
To download a file from ftp server
curl ftp://myftpsite.com/mp3/mozart_piano_sonata.zip --user myname:mypassword -o mozart_piano_sonata.zip
To upload a file to ftp server
curl -T koc_dance.mp3 ftp://myftpsite.com/mp3/ --user myname:mypassword
To list files in sub directories.
curl ftp://myftpsite.com/mp3/ --user myname:mypassword
List only directories, silent the curl progress bar, and use grep to filter
curl ftp://myftpsite.com --user myname:mypassword -s | grep ^d
Remove files from ftp server.
This is a bit tricky, because curl do not support that by default, well anyway, you can make use of -X and pass in the REAL FTP command.
(Check out a list of FTP service Command in rfc 959, under 4.1.3. FTP SERVICE COMMANDS)
curl ftp://myftpsite.com/ -X 'DELE mp3/koc_dance.mp3' --user myname:mypassword
Caution: Make sure you are know what are you deleting! It will not prompts ‘Are you sure?’ confirmation.
Check out curl manual for more,
man
- curl的ftp功能也不错
- 一个不错的Curl教程
- 一个不错的Curl教程
- 一个不错的Curl教程
- 一个不错的Curl教程
- 又一个不错的ftp站点
- 不错的功能
- 不错的手机正则表达式,解释的也还不错.
- php的curl也没这么复杂
- php的curl也没这么复杂
- 不错的sql面试题,学习也不错
- IOS上通过CURL的FTP上传下载,
- php ftp和curl遇到的bug
- 国内的一个不错的ftp搜索引擎
- 关于FTP上传的,不错的文章。
- zhanghaoran的ChinaUnix博客 - 也不错
- 看看外面的世界也不错。。。
- 这个地方的java基础也不错
- Documentation/fb目录中帮助文档的索引
- Eclipse中常用的的快捷键
- Circle类
- Linux/Ubuntu下的用户切换
- 【Jetty Server 开发系列之一】搭建Jetty Server环境&&Http客户端实现交互
- curl的ftp功能也不错
- 图的 Prim算法和Dijkstra算法
- Fibonacci堆的代码-欢迎斧正并且报告Bug
- 【C/S通信交互之Http篇】Cocos2dx(Client)使用Curl与Jetty(Server)实现手机网游Http通信框架(内含解决curl.h头文件找不到问题)
- QT 中Gtk-WARNING **: 无法在模块路径中找到主题引擎:“pixmap”?
- HITS算法解析与光年论坛的两个问题
- Java 网络通信
- Linux 安装 Mysql
- 使用DSP/BIOS数据类型