使用 FTP 下载特定文件名

Downloading Specific Filenames with FTP

我有大约 1,000,000 个文件,我应该 FTP 获取一些特定文件。 在 1,000,000 个名为 ML0000000-ML1000000 的文件中,我想要特定文件从 ML00002222 开始到 ML00899999。 任何人都可以帮我如何为 ftp 编辑 mget 吗?

######login to FTP server:@@@@@
ftp -inv 172.0.0.1
user Codegirl $$$$
#######cd to ftp server#########
cd /root/desktop
######cd to local PC#############
lcd /root/myfile
*mget ML*   ??? (how can i change it to specific file name?)*

如果是我,我会使用循环和 wget。

cd /root/myfile

for i in $(seq -f "%08g" 2222 899999)

do
  wget --username=un --password=pw ftp://172.0.0.1/root/desktop/ML${i}
done

这确实需要 wget 每次都重新连接,无论如何都需要时间,所以去 运行 脚本并喝杯茶。我一直使用这样的循环,效果很好。