How do I set the parameter of the following function?

Posted on 2011-02-24
Last Modified: 2012-05-11

I want to download files such as txt, exe, directories, etc .  from the URL link by using wget in linux.

Currently,  I am using wget   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?

Question by:nabilhammoud
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 68

Accepted Solution

woolmilkporc earned 100 total points
ID: 34969926

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.

LVL 68

Assisted Solution

woolmilkporc earned 100 total points
ID: 34970013

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!

LVL 14

Assisted Solution

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
How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

LVL 40

Assisted Solution

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

Author Comment

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

Assisted Solution

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

Author Closing Comment

ID: 34990273

Featured Post

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
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…
Suggested Courses

630 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