Mailinglist Archive: opensuse (3996 mails)

< Previous Next >
Re: [SLE] wget question
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Mon, 20 Sep 2004 09:32:51 -0700
  • Message-id: <200409200932.51812.rschulz@xxxxxxxxx>
Jim,

On Monday 20 September 2004 05:47, Jim Sabatke wrote:
> - Edwin - wrote:
> > On Mon, 20 Sep 2004 07:11:37 -0500
> >
> > Jim Sabatke <jsabatke@xxxxxxxxxx> wrote:
> >>How do I access a link with wget written in the following
> >>form?
> >>
> >>http://prdownloads.sourceforge.net/abiword/abiword-2.0.11.tar.gz?use_
> >>mirror=unc

Wget is very powerful. There are many options, but they're not
particularly difficult to understand, so you'd be well advised to
familiarize yourself with them. The "--help" output is over 100 lines
long.


> > Just type it after wget and it'll download the file.
> >
> > $ wget <the-long-url-here>
>
> I've tried that, a whole bunch of times. It creates a
> subdirectory prdownloads.sourceforge.net with the following:
>
> robot.txt
> abiword/
>
> and abiword/ contains
>
> abiword-2.0.11.tar.gz?mirror=mesh
>
> and it's not the right file. It's very short and am HTML
> file that lynx won't decode.

You can suppress the creation of directories based on the host name and
the leading directory components of the URL by giving wget the "-nd"
option. You can suppress the host-name directory with "-X" and you can
also have a leading sequence of some number of URL directory components
with "--cut-dirs=number".

You can get rid of URL query elements and, basically, totally override the
output file name with the "-O" option, though this is only really useful
for single-file retrievals, for the most part since it will concatentate
the retrieved data from all specified URLs into that file.


> I've tried every option in man and in the online manual.

Really? There are dozens of them!

In general, it's a good idea to quote long arguments like those typical
with wget (or to escape the special characters such as '*', '?', '[',
']', '{', '}', spaces and so on), though the likelihood that a glob
character would lead to a match with something on your system is remote.

Good luck.


> --
> Jim Sabatke


Randall Schulz

< Previous Next >
Follow Ups