Solved

How do I set the parameter of the following function?

Posted on 2011-02-24
7
326 Views
Last Modified: 2012-05-11
Dear,

I want to download files such as txt, exe, directories, etc .  from the URL link http://www.xxx.xx/xx/ by using wget in linux.

Currently,  I am using wget http://www.xxx.xx/xx/   and then I am specifying each file name alone.
What is the option used in wget to download all specified files on that repository?

Furthermore, When I am copying file “server.cpp” with wget to the my local host in the specified location it is making a new file with the name of server.cpp.1 rather than replacing it.

So, how to copy and replace all files by using wget in linux debian?

Nabil
0
Comment
Question by:nabilhammoud
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 100 total points
ID: 34969926
Hi.

wget does not support wildcards, but you can use the "-A" (accept) parameter to filter for extensions, e.g. -A.txt



Versioning of downloaded files cannot be turned off, afaik, but I might be wrong here.

wmp
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 100 total points
ID: 34970013
Correction:

When using "-r" (= recursive) existing files will be overwritten and not versioned.

To use "-r" but to avoid actual recursion use "-l 1" (= recurse one level) additionally.

See "man wget" for more!

wmp
0
 
LVL 14

Assisted Solution

by:svgmuc
svgmuc earned 50 total points
ID: 34970016
There is no way to force overwriting, as far as I know.

-nc prevents the multiple copies by preventing downloads if a file with the same name exists

As for the filetype-based download, try:

wget -r -l1 --no-parent -A .exe http://www.xxx.xx/xx/
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 100 total points
ID: 34970091
are you interested to download all file in the subfolder or files with specific extension?
0
 

Author Comment

by:nabilhammoud
ID: 34972251
I want to dwonload(copy and paste)  all files in the specific URL.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 100 total points
ID: 34973193
why don't you use the -r option of wget which will download all files and subfolders
0
 

Author Closing Comment

by:nabilhammoud
ID: 34990273
THX
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now