Computing.Net > Forums > Linux > Wget command question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Wget command question

Reply to Message Icon

Name: satimis
Date: November 15, 2004 at 23:07:13 Pacific
OS: FedoraCore2
CPU/Ram: Athlon/512M
Comment:

Hi folks,

FedoraCore2
==========

If I want to down a directory, say CCC from a website

WEBSITE -> AAA -> BBB -> CCC

Previously I used following command on terminal;

$ wget -no--parent [url]http://www.xyz.com/AAA/BBB/CCC/index.htm[/url]

then it will only download "CCC"
/CCC/index.htm

Now I use
$ wget -np -r [url]http://www.xyz.com/AAA/BBB/CCC/index.htm[/url]

It also downloaded the parent directories "www.xyz", AAA, BBB.

Please advise the correct syntax/command line to be used. TIA

B.R.
satimis



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: November 16, 2004 at 07:28:36 Pacific
Reply:

Try using:
$ wget -np -r -l 1 http://www.xyz.com/AAA/BBB/CCC/index.htm

NB That's "-l 1" for "--level=1" which restricts the recursion level to one.


0

Response Number 2
Name: satimis
Date: November 17, 2004 at 03:38:20 Pacific
Reply:

Hi 3Dave,

Tks for your advice.

Sorry
$ wget -np -r -l 1 http://www.xyz.com/AAA/BBB/CCC/index.htm
did not work.

Directories
www.xyz.com
AAA
BBB

all copied. What I need is only

CCC/index.htm

B.R.
satimis


0

Response Number 3
Name: 3Dave
Date: November 17, 2004 at 09:45:13 Pacific
Reply:

Then why not just:
$ wget http://www.xyz.com/AAA/BBB/CCC/index.htm

?


0

Response Number 4
Name: satimis
Date: November 18, 2004 at 04:49:00 Pacific
Reply:

Hi 3Dave,

$ wget http://www.xyz.com/AAA/BBB/CCC/index.htm
will download all directories/folders above

wget -m -c -np -nH --cut-dirs=2 -U Explorer http://www.xyz.com/AAA/BBB/CCC/index.htm

Works for me only downloading
BBB/CCC/index

B.R.
satimis


0

Response Number 5
Name: 3Dave
Date: November 18, 2004 at 06:47:49 Pacific
Reply:

Check that you haven't enabled recursive downloading in your ~/.wgetrc or /etc/wgetrc.
$ wget http://www.xyz.com/AAA/BBB/CCC/index.htm
should download only index.htm, I've just tried it with this page and it just downloaded the page and nothing else.

$ wget http://www.computing.net/linux/wwwboard/forum/26899.html
--14:45:16-- http://www.computing.net/linux/wwwboard/forum/26899.html
=> `26899.html'
Resolving www.computing.net... 69.93.141.100
Connecting to www.computing.net[69.93.141.100]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

[ <=> ] 18,356 54.28K/s

14:45:17 (54.00 KB/s) - `26899.html' saved [18356]
$


0

Related Posts

See More



Response Number 6
Name: satimis
Date: November 24, 2004 at 03:01:24 Pacific
Reply:

Hi 3Dave,

>Check that you haven't enabled recursive
>downloading in your ~/.wgetrc or /etc/wgetrc.

Something strange happened here on "wget"

# cat /etc/wgetrc
.....
reclevel = 1 (also tried '5')
waitretry = 10
#recursive = off (also tried uncomment it)
.....

$ wget http://kristi.erdves.lt/books/Computah%20Stuff/unix-linux/Teach_Yourself_Shell_Programming_In_24hrs.tar/ewtoc.html

only the index.html page downloaded. If uncomment "recursive = off", nothing downloaded.

I must add "-r" option. But it downloaded the parent directories above;

kristi.erdves.lt/books/Computah\ Stuff/unix-linux/Teach_Yourself_Shell_Programming_In_24hrs.tar/

B.R.
satimis



0

Response Number 7
Name: 3Dave
Date: November 24, 2004 at 04:27:02 Pacific
Reply:

This worked for me:
$ wget -r -L -nH -np --cut-dirs=4 http://kristi.erdves.lt/books/Computah%20Stuff/unix-linux/Teach_Yourself_Shell_Programming_In_24hrs.tar/


0

Response Number 8
Name: satimis
Date: November 24, 2004 at 18:21:38 Pacific
Reply:

Hi 3Dave,

Your advice also worked for me. But changing "--cut-dirs=4" to "--cut-dirs=3" will keep the folder "Teach_Yourself_Shell_Programming_In_24hrs.tar"

B.R.
satimis


0

Response Number 9
Name: 3Dave
Date: November 25, 2004 at 02:20:17 Pacific
Reply:

Looks like a good link, I think I'll download it myself too....cheerz.


0

Sponsored Link
Ads by Google
Reply to Message Icon

ipchains state INVALID,NE... the command netstat



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Wget command question

Simple Command question www.computing.net/answers/linux/simple-command-question/3181.html

Command question www.computing.net/answers/linux/command-question/27608.html

Tar command question www.computing.net/answers/linux/tar-command-question/23217.html