一个能够保持原来文件的目录结构的autoindex网页的下载脚本

标题好绕 @_@

function get-url-item {
    echo $1 | awk -F/ '{ print $'$2' }'
}

cut=0
url=$1

# count what our --cut-dir should be, this is nasty to the max
while  -n `get-url-item $url $ $cut + 4 ]` ]]; do
    cut=$ $cut + 1 ]
done

wget -c -N -nH -r -R "index.html*" -np --cut-dir=$cut $url

把以上脚本保存为wgeta,然后加可执行权限,加到PATH中,就可以使用了。

网上找到的,亲测还蛮好用。

感谢楼主分享