Linux.com

Tips

Posted by: Anonymous Coward on September 13, 2005 05:23 AM
This command may have unexpected results:

wget -cr <a href="ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware-current/" title="psu.edu">ftp://carroll.cac.psu.edu/pub/linux/distributions<nobr>/<wbr></nobr> slackware/slackware-current/</a psu.edu>

wget may follow the link to the parent directory and end up mirroring the whole FTP. From the wget man page:


  -np

  --no-parent
Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded.

Next, another helpful option: Specify exact;y which filetypes you want. The -A option, the accept list, can take a list of extentions that wget should retrieve from the target. It might not be useful with that particular FTP, but FTPs with mixed filetypes. If you wanted to get all the music files from a directory on a FTP, you would do this:

wget -cr -np -A mp3,ogg,flac,mpc <a href="ftp://somesite/somedirectory/" title="somesite">ftp://somesite/somedirectory/</a somesite>

#

Return to CLI Magic: the word on wget