我有一个名为files.txt的文件,其中包含我想下载的所有文件。
files.txt
http://file/to/download/IC_0000.tpl
http://file/to/download/IC_0001.tpl如果我用
cat files.txt | egrep -v "(^#.*|^$)" | xargs -n 1 wget所有文件都会被下载。
但是,如果files.txt只包含没有http的文件,我不知道如何使用
files.txt
IC_0000.tpl
IC_0001.tpl我只对这位情人说"wget“:
Usage: wget [-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]
[--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
[--no-check-certificate] [-U|--user-agent AGENT] [-T SEC] URL...你能帮帮我吗拜托。
非常感谢。
发布于 2014-12-06 18:26:35
只需尝试wget -i files.txt (参见http://www.gnu.org/software/wget/manual/wget.html#Logging-and-Input-File-Options)
如果文件中没有主机,请尝试:
for i in `cat files.txt`; do wget "${HOST}/${i}"; done发布于 2015-08-31 08:59:04
把它留在这里..。对于MacOSX
file_name=newMP3List.txt && cur_path=$(pwd) && split -l 50 $file_name PART && find . -name "PART*" -print0 | xargs -0 -I f osascript -e "tell application \"Terminal\" to do script \"cd $cur_path && cat f | while read CMD; do curl -O \\\"\$CMD\\\"; done; rm f;\""对于linux
cat newMP3List.txt | while read CMD; do curl -O $CMD; done;需要用文件名替换newMP3List.txt
https://stackoverflow.com/questions/27334926
复制相似问题