How do I set the parameter of the following function?

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
nabilhammoudAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
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
 
woolmilkporcConnect With a Mentor Commented:
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
 
svgmucConnect With a Mentor Commented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
omarfaridConnect With a Mentor Commented:
are you interested to download all file in the subfolder or files with specific extension?
0
 
nabilhammoudAuthor Commented:
I want to dwonload(copy and paste)  all files in the specific URL.
0
 
omarfaridConnect With a Mentor Commented:
why don't you use the -r option of wget which will download all files and subfolders
0
 
nabilhammoudAuthor Commented:
THX
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.