用wget 命令下载某个源码目录,
wget -r -np -nH -R index.html https://source.ipfire.org/source-2.x/
各个参数的含义:
-r : 遍历所有子目录
-np : 不到上一层子目录去
-nH : 不要将文件保存到主机名文件夹
-R index.html : 不下载 index.html 文件
下载了一天了, 意外关机。
就想着把剩下的没下载完成的下载了, 又不想写脚本,想起之前见别人用一句话命令6的很,也想用,就练习了下。
先到https://source.ipfire.org/source-2.x/ 复制了页面, 保存到test.txt里。cat test.txt |awk ‘{print $1}’> pkg.list 。
while read line; do if [ -f "$line" ]; then echo "$line"; else wget "https://source.ipfire.org/source-2.x/""$line"; fi; done < ../pkg.list