壳/ bash的一个会话递归FTP目录列表(使用卷曲或FTP) [英] Recursive FTP directory listing in shell/bash with a single session (using cURL or ftp)

查看:188
本文介绍了壳/ bash的一个会话递归FTP目录列表(使用卷曲或FTP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个小shellscript里,需要通过FTP服务器(递归)上的所有文件夹和文件。到目前为止,一切工作正常使用卷曲 - 但它是pretty慢,监守卷曲每命令启动一个新的会话。因此,对于500个目录,卷曲preforms 500登录。

I am writing a little shellscript that needs to go through all folders and files on an ftp server (recursively). So far everything works fine using cURL - but it's pretty slow, becuase cURL starts a new session for every command. So for 500 directories, cURL preforms 500 logins.

有谁知道,我是否可以使用卷曲保持登录状态(这将是我最喜欢的解决方案),或者我怎么能FTP只有一个区段在shell脚本中使用?

Does anybody know, whether I can stay logged in using cURL (this would be my favourite solution) or how I can use ftp with only one session in a shell script?

我知道如何执行一组FTP命令和检索响应,但对于上市递归,它必须是多了几分动感...

I know how to execute a set of ftp commands and retrieve the response, but for the recursive listing, it has to be a little more dynamic...

感谢您的帮助!

推荐答案

该命令实际上是 ncftpls -R 。这将递归列出一个FTP文件夹中的所有文件。

The command is actually ncftpls -R. It will recursively list all the files in a ftp folder.

这篇关于壳/ bash的一个会话递归FTP目录列表(使用卷曲或FTP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆