Results 1 to 2 of 2

Thread: Using WGET to download files

  1. #1
    Join Date
    Sep 2003
    Posts
    3,040

    Default Using WGET to download files

    Wget is a very versatile tool for downloading multiple files from a web page. For e.g very often u see web pages that have listed files in *.pdf or *.tar.gz, and they are just too many of them to be downloaded by cinventional method.
    WGET comes to the rescue. This is a tool available on major linux distros.A similar tool "Teleport" is available on Windows.

    for e.g. consider the following web site.
    http://www.ulib.org/webRoot/Books/Nu.../bookcpdf.html

    There are many pdf's listed that need to be downloaded. This can be done using the following command

    %>wget -r -l 1 -A pdf -nd http://www.ulib.org/webRoot/Books/Nu.../bookcpdf.html

    Here -r flag denotes that recursively go through each link.
    -l 1 specifies that recurive depth is just 1
    -A pdf specifies that the files to be downloaded have a pdf extension.. Additional extenstions can be specified by seperating them using a comma
    -nd specifes that no directories should be formed. Hence all the files will be downloaded to the CURRENT directory


    More info on this tool can be had by using the following command:

    %>wget --help
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default Downloading multiple files in background

    Downloading multiple files in background

    To download multiple files using wget in background create a text file with urls.

    Eg:

    url.txt


    http://www.bizhat.com/movie1.mpg
    http://www.bizhat.com/movie2.mpg
    http://www.bizhat.com/movie3.mpg
    http://www.bizhat.com/movie4.mpg



    now in shell prompt run

    # wget -b -i url.txt

    You will see some thing like

    [root@host1 movie]# wget -b -i url.txt
    Continuing in background, pid 30181.
    Output will be written to `wget-log'.
    [root@host1 movie]#
    Now check the file

    wget-log in current directory to know the status of wget file downloading.

    You will get the command like back, so u can continue working on shell prompt, wget work in background.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •