LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神,可以点击顶部导航 Contact 按钮进行投稿。
  • Laptops

Related entries

Latest entries

wget 使用技巧

wget 是一个命令行的下载工具。对于我们这些 Linux 用户来说,几乎每天都在使用它。下面为大家介绍几个有用的 wget 小技巧,可以让你更加高效而灵活的使用 wget。

  1. $ wget -r -np -nd http://example.com/packages/

    这条命令可以下载 http://example.com 网站上 packages 目录中的所有文件。其中,-np 的作用是不遍历父目录,-nd 表示不在本机重新创建目录结构。

  2. $ wget -r -np -nd --accept=iso http://example.com/centos-5/i386/

    与上一条命令相似,但多加了一个 --accept=iso 选项,这指示 wget 仅下载 i386 目录中所有扩展名为 iso 的文件。你也可以指定多个扩展名,只需用逗号分隔即可。

  3. $ wget -i filename.txt

    此命令常用于批量下载的情形,把所有需要下载文件的地址放到 filename.txt 中,然后 wget 就会自动为你下载所有文件了。

  4. $ wget -c http://example.com/really-big-file.iso

    这里所指定的 -c 选项的作用为断点续传。

  5. $ wget -m -k (-H) http://www.example.com/

    该命令可用来镜像一个网站,wget 将对链接进行转换。如果网站中的图像是放在另外的站点,那么可以使用 -H 选项。

[via]

25 Comments

  1. wyg1258 1 wyg1258 Commented @ 2007-10-14 10:15 am

    很实用的介绍

  2. Anderson 2 Anderson Commented @ 2007-10-14 10:15 am

    网络状况不好的时候用wget就对了,非常非常稳定

  3. stlxv 3 stlxv Commented @ 2007-10-14 11:04 am

    “对于我们这些 Linux 用户来说,几乎每天都在使用它。”

    像我这种,是几乎从来不用它…….

  4. biowee 4 biowee Commented @ 2007-10-14 11:09 am

    不错!如果使用图形界面的,有gwget可以使用。

  5. Jake 5 Jake Commented @ 2007-10-14 11:31 am

    非常有用。谢谢。

  6. lh 6 lh Commented @ 2007-10-14 3:28 pm

    如果ie下载有wget这样的功能就好了。再win下下载是越下越慢。linux下没有这样的情况

  7. mumonitor 7 mumonitor Commented @ 2007-10-14 3:43 pm

    3,4一直用,其他的学习了,多谢!

  8. zissan 8 zissan Commented @ 2007-10-14 4:16 pm

    看来我和stlxv属于另类了 :-)

  9. Sutra 9 Sutra Commented @ 2007-10-14 4:40 pm

    To lh:
    Win 下也有wget for windows 的呀。

  10. ding 10 ding Commented @ 2007-10-14 5:00 pm

    学习 收藏了!

  11. wget 使用技巧 at 创意纪 11 wget 使用技巧 at 创意纪 Pingbacked @ 2007-10-14 8:10 pm

    […] $ wget -m -k (-H) http://www.example.com/该命令可用来镜像一个网站,wget 将对链接进行转换。如果网站中的图像是放在另外的站点,那么可以使用 -H 选项。 转载自这里。 Related Posts开源搜索引擎Nutch全攻略 […]

  12. John 12 John Commented @ 2007-10-15 9:22 am

    wget 也有windows下的版本。我一直在用,非常好用。

  13. sbilly 13 sbilly Commented @ 2007-10-15 10:16 am

    我也一直用 wget 呵呵~
    Linux/Solaris/Windows …

  14. My Open Course Ware » wget 使用技巧 14 My Open Course Ware » wget 使用技巧 Pingbacked @ 2007-10-15 11:09 am

    […] Linux下很有用的下载工具wget的使用方法。虽然直接man可以得到,但是人家整理出来并翻译了,吸收消化还是很不错的。转载自LinuxTOY,原文在这里: […]

  15. NightOwl 15 NightOwl Commented @ 2007-10-15 2:46 pm

    对于上面的朋友说的在windows下不能用wget的问题,有一个比较好的解决方案。Ming Bai(http://mbbill.googlepages.com/)推荐了一个 unxutils 的windows工具包。里面包括了静态编译好的很多unix/Linux下面的工具(当然包括wget)。这个包的好处是体积非常小,而且不依赖任何动态连接库。感兴趣的朋友可以在如下地址下载到:http://unxutils.sourceforge.net/

  16. sendney 16 sendney Commented @ 2007-10-15 10:31 pm

    wget支持多线程下载吗???

  17. 宏奋 17 宏奋 Commented @ 2007-10-17 1:04 am

    to sendney:

    wget不支持多线程下载, 要想用多线程方式,推荐用axel,请google:)

  18. islet8 18 islet8 Commented @ 2007-10-17 9:25 am

    @sendney:据说多线程下载是中国特色,本身对服务器来说弊大于利
    wget的单线程模式仍然很快啊,不信你试试,我现在主要都用gwget,像d4x、multiget都不用了

  19. links for 2007-10-17 « /tmp 19 links for 2007-10-17 « /tmp Pingbacked @ 2007-10-18 12:18 am

    […] wget 使用技巧 - LinuxTOY (tags: linux wget) […]

  20. linuxl 20 linuxl Commented @ 2007-10-18 4:38 pm

    linux的镜像一般都挺快,单线程足够了~

  21. links for 2007-10-19 at Systems Thoughts 21 links for 2007-10-19 at Systems Thoughts Pingbacked @ 2007-10-20 7:21 am

    […] wget 使用技巧 - LinuxTOY (tags: linux tip wget) Leave a Reply […]

  22. use wget at Spritewood 22 use wget at Spritewood Pingbacked @ 2007-10-30 3:25 pm

    […] http://linuxtoy.org/archives/wget-tips.html […]

  23. wget 使用技巧 | 人生得意须尽欢 23 wget 使用技巧 | 人生得意须尽欢 Pingbacked @ 2007-11-29 5:24 pm

    […] → 转载时务必以超链接形式标明文章原始出处及作者信息。 → 本文网址:http://linuxtoy.org/archives/wget-tips.html […]

  24. Vayn技术网摘 » wget 使用技巧 24 Vayn技术网摘 » wget 使用技巧 Pingbacked @ 2008-02-09 4:04 am

    […] [本文转载自LinuxToy:http://linuxtoy.org/archives/wget-tips.html][via] […]

  25. peter’s blog » Blog Archive » 服务器 25 peter’s blog » Blog Archive » 服务器 Pingbacked @ 2008-02-24 4:37 pm

    […] 源文档 <http://linuxtoy.org/archives/wget-tips.html> […]