Score:0

Downloading a file using Windows CMD line with curl/wget

in flag

I have a client [Windows 10 VM] and a server [say a linux based VM].

I have Apache running on the Linux Server.

I have a file on the linux server that I want to download on my windows client.

I want to do it in 2 ways from the windows CMD: -Using curl -using wget

I tried the foll commands on my windows CMD. But doesnt work. Is something wrong with my CLI?

curl http://x.x.x.x/home/abc/ -O test.zip
wget http://x.x.x.x/home/abc/ -O test.zip

Edit:: Insense, I wanted to understand the right CLI syntax to do a wget/curl to fetch a file from a certain directory on the remote server (/home/abc)

Massimo avatar
ng flag
Please explain "doesn't work".
Software Fan avatar
in flag
@MassimoEdit:: Insense, I wanted to understand the right CLI syntax to do a wget/curl to fetch a file from a certain directory on the remote server (/home/abc)
Massimo avatar
ng flag
`wget` is not a standard Windows command; `curl` actually is (at least since Windows 10 1803), and you can have a look at its syntax using `curl --help`.
Massimo avatar
ng flag
Also, if you are using PowerShell, both commands are aliases for `Invoke-WebRequest`.
Score:1
cn flag

If you want to retrieve a file stored on another server, you will prefer to use a tool like SCP which can get files throught SSH. Curl is commonly used for Web requests.

The syntax for SCP is scp myuser@src_server:/home/abc/distantfile.zip ./localfile.zip

Graphicly, you can use WinSCP

Score:0
cn flag

No third party required, you can use PowerShell command Invoke-WebRequest.

Example: Invoke-WebRequest http://x.x.x.x/home/abc/ -OutFile test.zip

There are additional arguments for adding headers, specifying authentication, and so forth.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.