LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-11-2004, 01:00 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Wget - syntax question


Hi folks,

What will be the correct sytnax to download a document from a website including all links but excluding mother-diretories/folders, e.g.

The document named CDoc, under www.abc.com/dir_1/dir_2/dir_3/CDoc/

# wget -r www.abc.com/dir_1/dir_2/dir_3/CDoc/

download all directories/folders above. I only need /CDoc/

TIA

B.R.
satimis
 
Old 09-11-2004, 01:34 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
I use --cut-dirs=# where is the number of directories before the one you want.

For example, if I want to get the SRPMS from this site, that has 9 directories before it.
Code:
wget -cm -nH --passive --cut-dirs=9 \
ftp://mirror.dulug.duke.edu \
/ftp.redhat.com/pub/redhat/linux/enterprise/3/en/os/i386/SRPMS
 
Old 09-11-2004, 03:28 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi homey,

Tks for your advice.
Code:
wget -cm -nH --passive --cut-dirs=9 \
ftp://mirror.dulug.duke.edu \
/ftp.redhat.com/pub/redhat/linux/enterprise/3/en/os/i386/SRPMS
On man wget

-cm
m=mirror
c=continure=r

Re '--cut-dirs=9'
wiil www.abc.com be counted as 1 (one) directory?

If I'm wrong please correct me.

TIA

B.R.
satimis

Last edited by satimis; 09-13-2004 at 11:45 AM.
 
Old 09-11-2004, 03:29 AM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi homey,

Tks for your advice.
Code:
wget -cm -nH --passive --cut-dirs=9 \
ftp://mirror.dulug.duke.edu \
/ftp.redhat.com/pub/redhat/linux/enterprise/3/en/os/i386/SRPMS
On man wget

-cm
m=mirror
c=continure=r

Re '--cut-dirs=9'
wiil www.abc.com be counted as 1 (one) directory?

If I'm wrong please correct me.

TIA

B.R.
satimis
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wget question kpachopoulos Linux - General 1 07-23-2005 10:00 AM
wget question Yohhan Linux - Software 1 05-05-2004 07:49 PM
wget question ziggie216 Linux - Software 1 10-12-2003 01:10 PM
wget question ziggie216 Linux - Software 0 10-12-2003 12:02 PM
wget question satimis Linux - Software 4 07-14-2003 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration