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
From curl side, most probably curl.exe is missed on Windows Client machine or could not find it. One of the options is to download curl:
Download curl zip for Windows from this page: https://curl.se/download.html
Unzip and you will find the ..\bin\curl.exe
Also add ...\bin\ to your Path variable in System Settings.
To use wget in Windows, you can follow this link and it worked for me: https://medium.com/nerd-for-tech/using-wget-command-in-windows-10-environment-d766b8f526e9
Short tutorial:
Download the GnuWin setup
Install it
Open the wget directory
Add to Environmet Variables as well.
Related
I'm trying to install curl from the following link
https://curl.haxx.se/download.html
from Windows 64 - Generic. But the zip folder doesn't have curl.exe file. I don't know what to do. How do I run curl in my cmd?
I have downloaded this one:
Win64 x86_64 7zip 7.49.1 binary SSL SSH Viktor Szakáts 1.81 MB
and the zip folder contains a curl.exe (within the bin folder).
Go to this directory with cmd and just enter curl --help or any other curl command.
I am using curl on mac and other windows machines to upload my artifacts to HockeyApp service. On one of my machines that runs windows , "curl" constantly "hangs/freezes" during upload.
Here is the command :
curl -F notify=0 -F status=2 -F ipa=#app/build/outputs/apk/app-production-release-2.4.2-SNAPSHOTv42.apk -F dsym=#app/build/outputs/mapping/production/release/mapping.txt -H X-HockeyAppToken:[MY_TOKEN_HERE]https://rink.hockeyapp.net/api/2/apps/[MY_APP_REFERENCE]/app_versions/upload
On windows there is no curl by default , so I use the one installed with this git distribution. I just add the path to curl to path environmental variable. This approach works well on 2 other windows machines. In fact when I open git-bash , the curl command also executes fine. But any attempt to run it from cmd.exe leads to "hanging/freezing".
Any idea on how can I troubleshoot/debug it ?
EDIT :
I have already tried other curl distributions for windows , same result...
I've been struggling with the same issue of curl as well when trying to deploy my app from VSTS to Hockeyapp. in the end I've chosen for not using curl but just using plain powershell on Windows. it's a bit more complicated but it works the same way.
I've uploaded this script to GitHub and can be found there:
https://github.com/Geertvdc/UWPHockeyAppDeployScripts/blob/master/UploadUWPToHockeyApp.ps1
so instead of curl I use Invoke-RestMethod from powershell to do the same call to Hockeyapp.
Try to upgrade your curl to the latest version
where curl
find out where current path of curl, using cywin cli
https://curl.haxx.se/windows/
Come here to find version you want update, download and give it a try.
Reason for this freezing is base on Windows config. I have laptop that need to ghost new installation of Windows 10. Before ghost, curl run well. After ghost, sometime it freezing.
I updated and it runs well now.
Also notice that when run
curl -s
curl will run in silent mode, that never hang out
I am trying to download a zip file using wget directly from my EC2 instance. The command actually works and a file is downloaded, however it is a fraction of the size it is supposed to be (supposed to be 7 GB and the file downloaded is 14K) and unzip commands are not working.
Any ideas? I'd prefer not to download the file to my local computer and then use scp (although if I have to I guess that is what I'll do)
Found the issue, the website requires authentication before downloading the file, so I believe I just need to add login credentials as parameters in the wget command:
wget --user=user --password=password
I am trying to run a Curl command wrapped inside Ruby code as below:
f=IO.popen("C:\Windows\System32\curl.exe -H 'Authorization: Bearer #{token}' -s -v -D - http://api.pageuppeople.com/v1/NAS/Config/LanguageDictionary/Overrides --debug 2>NUL").readlines
However, the output I get is:
'curl' is not recognized as an internal or external command, operable program or batch file
I am running on Windows 7.
I also have "C:\Windows\System32" set in the environment path.
Please help.
curl is not a component of Windows. Unless you have specifically installed it, it won't exist on the system.
I am not a Ruby expert, but I suspect that you should really be using the Net::HTTP Ruby library here, or something similar to it. Even on a system where curl is installed, launching it is not a sensible way of running an HTTP request.
Curl does not come with Windows, but it has been ported to Windows.
You can download it here:
http://sourceforge.net/projects/gnuwin32/file
I know nothing about Ruby, but I do know you shuld be using a native libary for your HTTP needs.
CURL is not a Windows component. Download curl.exe and keep it in your path.
Alternatively download curl.exe and invoke the command from the same folder.
Windows 10 now provides C:\Windows\System32\curl.exe but I still see that error message when I try to call it from a service (Jenkins user in my case).
I'll post an update when I find out something more (e.g. which user rights are necessary).
I've installed curl now with chocolatey. See https://chocolatey.org/packages/curl.
I have installed Cygwin & curl(through cygwin installer) on my Windows7 32bit. Then opened cygwin terminal and typed curl --help. Everything works fine with curl showing its command arguments list.
But curl http://www.google.com or any other url takes more time and results
"curl: (52) Empty reply from server
". What is the problem?
Update:Iam behind a proxy server. Any pblm with that?
If your proxy server is the only way to get out at the web, then yes, that's the problem. Curl couldn't care less about what OS you're running under, so won't get for OS-specific proxy settings (ie: Internet Explorer options), so it'll try to do a direct connection. Try adding the --proxy option (curl --help will give the format).