0

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)

Software Fan
  • 101
  • 1
  • 2
  • Please explain "doesn't work". – Massimo Nov 16 '21 at 23:20
  • @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) – Software Fan Nov 16 '21 at 23:22
  • 1
    `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 Nov 16 '21 at 23:27
  • 2
    Also, if you are using PowerShell, both commands are aliases for `Invoke-WebRequest`. – Massimo Nov 16 '21 at 23:27

2 Answers2

1

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

Martin
  • 474
  • 1
  • 11
0

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.

Conure
  • 96
  • 2