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)

4
  • Please explain "doesn't work". Commented Nov 16, 2021 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) Commented Nov 16, 2021 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. Commented Nov 16, 2021 at 23:27
  • 2
    Also, if you are using PowerShell, both commands are aliases for Invoke-WebRequest. Commented Nov 16, 2021 at 23:27

2 Answers 2

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

1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.