简体   繁体   English

使用 FTP 下载特定文件名

[英]Downloading Specific Filenames with FTP

I have about 1,000,000 files and I should do FTP to get some specific files.我有大约 1,000,000 个文件,我应该做 FTP 来获取一些特定的文件。 in 1,000,000 files with the name of ML0000000-ML1000000 i want specific file starts ML00002222 till ML00899999.在名为 ML0000000-ML1000000 的 1,000,000 个文件中,我希望特定文件从 ML00002222 开始直到 ML00899999。 can anyone help me how to edir mget for ftp?谁能帮助我如何编辑 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?)*

If it was me I'd use a loop and wget.如果是我,我会使用循环和 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

This does require wget to reconnect each time, it's going to take time anyway so go and run the script and grab a cup of tea.这确实需要 wget 每次都重新连接,无论如何这都需要时间,所以 go 并运行脚本并喝杯茶。 I use loops like this all the time and it works well.我一直使用这样的循环并且效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM