如何在Linux上通过FTP递归下载文件夹 [英] How to recursively download a folder via FTP on Linux
问题描述
我试图使用命令行ftp客户端ftp文件夹,但到目前为止,我只能使用'get'获取单个文件。
I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files.
推荐答案
你可以依靠通常处理ftp的wget获得正确的(至少在我自己的经验)。例如:
You could rely on wget which usually handles ftp get properly (at least in my own experience). For example:
wget -r ftp://user:pass@server.com/
您也可以使用适用于镜像的 -m
。它目前相当于 -r -N -l inf
。
You can also use -m
which is suitable for mirroring. It is currently equivalent to -r -N -l inf
.
如果您在凭证详细信息,可以指定 - user
和 - password
参数以使其正常工作。具有特定字符的自定义登录示例:
If you've some special characters in the credential details, you can specify the --user
and --password
arguments to get it to work. Example with custom login with specific characters:
wget -r --user="user@login" --password="Pa$$wo|^D" ftp://server.com/
这篇关于如何在Linux上通过FTP递归下载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!