Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I set the parameter of the following function?

Posted on 2011-02-24
7
Medium Priority
?
333 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 300 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 300 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 150 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 300 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 300 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 your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

971 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