cURL is a CLI tool for issuing HTTP GET, POST, & PUT request.

learn more… | top users | synonyms

30
votes
2answers
6k views

What is the difference between curl and wget?

I am keen to know the difference between curl and wget. Both are used to get files and documents but what the key difference between them... Why are there two different methods?
26
votes
2answers
20k views

Does curl have a --no-check-certificate option like wget?

I am trying to make a curl request to one of our local development servers running a dev site with a self-signed SSL cert. I am using curl from the command line. I saw some blog posts mentioning that ...
12
votes
3answers
6k views

Throttle the download speed of wget or curl while downloading

Is it possible to throttle (limit) the download speed of wget or curl ? Is it possible to change the throttle value while it is downloading ?
8
votes
3answers
1k views

Automating web requests using curl?

I have some "corporative" systems I have to use at work. Some of them are terrible, with frames, pop-ups and such. I was thinking about automating some stuff using curl or something like that. I need ...
7
votes
6answers
1k views

Is there a way to use curl interactively? Or is there an interactive curl/wget shell?

Imagine something like this: $ curlsh http://www.example.org > GET /foo/bar/bam ...output here... > POST /thing/pool ... ... result here.... is there a tool that lets me do that?
7
votes
2answers
3k views

Get URL's redirect target with curl

I would like to check where a single URL redirects. An example of that could be a link from Google's search result page (where a click always goes through Google server). Can I do that with curl?
6
votes
2answers
2k views

Can't understand this script. bash <<(curl -s http://xxx.com)

In a rails book, the author wrote the script to install ruby rvm. bash <<(curl -s https://rvm.beginrescueend.com/install/rvm) But I don't understand how it works. Could you explain this?
6
votes
2answers
688 views

Pipe Password to Application When Asked

The following should be done in a bash script: curl --digest --user schmijos https://bitbucket.org/u/p/get/tip.zip -o tip.zip How can I automatically submit a password to curl when it asks for it? ...
6
votes
5answers
777 views

Read and confirm shell script before piping from curl to sh (curl -s [url] | sh)

Whenever I have to execute a shell script from the web curl -s [url] | sh, I first open url in my web browser to make sure the script isn't malicious and is safe to run. I remember seeing a command ...
6
votes
1answer
456 views

How to download all images whose size>100kb in a webpage?

I want to download images contained in some web pages, but only those that are larger than 100 KB. So far I've been downloading all the images and then deleting the small ones, but it's not very ...
6
votes
2answers
323 views

Are there any good tools besides SeleniumRC that can fetch webpages including content post-painted by JavaScript?

One major shortcoming of curl is that more and more wepages are having their main piece of content painted by a JavaScript AJAX response that occurs after the initial HTTP response. curl never picks ...
5
votes
2answers
3k views

Any way to encode the url in curl command?

I have some url which has space in it's query param. I want to use this in curl, e.g. curl -G "http://localhost:30001/data?zip=47401&utc_begin=2013-8-1 00:00:00&utc_end=2013-8-2 ...
5
votes
2answers
5k views

loop curl get request bash

I'm trying to automate a curl script and eventually make it loop also. I found that I can't use any loop like: for i in `cat authors` do curl *line here* ...
5
votes
2answers
286 views

Make vim / curl recognize https:// links

I recently noticed vim/vimdiff can open links (using curl, it seems), which is an awesome feature. I wanted to use it today, like this: vimdiff deps ...
5
votes
2answers
163 views

cURL <- feature

$ cat file | curl -F 'sprunge=<-' http://sprunge.us So the output of echo gets passed as a POST parameter to cURL. Is this a cURL specific feature?
4
votes
3answers
200 views

Send first line of the HTTP Header

A normal HTTP request may look something like this: GET / HTTP/1.1 Host: example.com I would like to change the first line of this request, with a custom one, e.g.: FOOBAR NOT REALLY HTTP Host: ...
4
votes
4answers
2k views

Most straightforward way of getting a raw, unparsed HTTPS response

What would be the most straightforward way of making a GET request to a url over HTTPS, and getting the raw, unparsed response? Could this be achieved with curl? If so, what options would you need to ...
4
votes
3answers
7k views

How do I get the http status of a site in bash?

I figure curl would do the job. I wrote in a bash script: #!/bin/sh function test { res=`curl -I $1 | grep HTTP/1.1 | awk {'print $2'}` if [ $res -ne 200 ] then echo "Error $res ...
4
votes
2answers
10k views

Set a network range in the no_proxy environment variable

I'm in a network using a proxy. I've got machines using lots of scripts here and there accessing each other over HTTP. The network is 10.0.0.0/8. My proxy is 10.1.1.1:81, so I set it up accordingly: ...
4
votes
3answers
89 views

download only first few bytes of a source page

I am downloading the HTML source page of a website using cURL command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a ...
4
votes
1answer
504 views

'watch'-ing curl yields unexpected output

I'm trying to watch curl for live feedback on HTTP tweaks. However, when I execute the command, the output is garbled with some download stats. I've tried sending curl's stderr to /dev/null, to no ...
4
votes
2answers
35 views

How to check whether a command such as curl completed without error?

I am using curl to upload a file to a server via an HTTP post. curl -X POST -d@myfile.txt server-URL When I manually execute this command on the command line, I get a response from the server like ...
3
votes
3answers
2k views

How do I use curl to download content from sourceforge?

Simply typing http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz works fine on a browser, but I'm trying to download from a CLI environment with limited utilities. ...
3
votes
3answers
699 views

Curl with ipv6 not working by default

I am trying to curl ipv6 addresses, but without success. If I try lets say: curl https://google.com I wait for a timeout and get network unreachable If I force ipv4, everything is fine. ...
3
votes
3answers
1k views

How to download videos from Coursera with curl?

Downloading videos from Coursera is not as easy as copy and pasting the link in terminal. I also have tried exporting cookies from my browser in cookie.txt file and doing a: curl --cookie cookie.txt ...
2
votes
2answers
554 views

twitter status updates from command line (via cURL) [duplicate]

Based on some samples: http://www.commandlinefu.com/commands/view/176/update-twitter-via-curl I'm trying to update my twitter status from command line (via cURL), but always get error. Any idea what ...
2
votes
2answers
527 views

what does Curl's stand-alone hyphen (-) mean?

what's the stand-alone hyphen (between the -C & -O) stand for in this command? curl -C - -O http://www.intersil.com/content/dam/Intersil/documents/fn67/fn6742.pdf FWIW- I'm following a ...
2
votes
2answers
159 views

Is there a OS/user-wide log to log to?

I'm using curl to dowload a jar from a TESTDRIVE script and for debugging purposes it helps to log the http headers returned to a log file. But logging them in the working dir (where the script is ...
2
votes
3answers
286 views

Source (.) piped curl output

I have a file, f, on my webserver with the following contents: alias ll='ls -l' I would like to (from another linux box) do the following, but I can't get the command right: curl http://myserver/f ...
2
votes
2answers
755 views

Puzzle: transfering files between two servers (ssh, ftp, http multipart…)

A puzzle: files being uploaded in realtime by SCP to SERVER1 need to be transfered to SERVER2. But: SERVER1 doesn't actually have network access to SERVER2 (NAT), however SERVER2 has SSH access to ...
2
votes
1answer
348 views

download pdf files from using curl

How to download hundereds of .pdf files from http://www.ncbi.nlm.nih.gov/pmc/articles using a loop, for example for the following document ids: PMC3386155 PMC3625956 PMC3477654 PMC3531051 ...
2
votes
1answer
349 views

Strange issue with curl/lynx and non resolving domains

I have a weird issue on my server in that if I use curl or lynx to try and access a URL that doesn't exist (say a non registered domain, or a domain that's not in DNS), I don't get an error, it ...
2
votes
1answer
1k views

How can I queue up an entire directory for FTP?

Currently I know how to do this: curl -T file.zip ftp://server.domain.com/ --user username:password Which will let me do a single file. However I can't figure out how to do it for a directory. I ...
2
votes
2answers
2k views

curl several files and save output in one file

I am using curl to grab the HTML of a website. I want to only grab the first 20 lines, and save this in an external file. I need to grab about 10 URLs, and want to save all of them in the same file. ...
2
votes
1answer
2k views

curl --resolve appears to do nothing

The --help output for curl lists a --resolve option, which states --resolve <host:port:address> Force resolve of HOST:PORT to ADDRESS I'm not having any luck getting it to work though. The ...
2
votes
2answers
271 views

Using “&&” is not effective for cURL submit form (don't execute second line if first line fails)

I'm submitting to my website using cURL. I make cURL post it in timely fashion. In below code; first line is curl submit; second line is for queuing: curl -b cookies.txt \ -d title="$(sed ...
2
votes
1answer
335 views

Why is wget skipping files while trying to mirror a site

I ran wget on this site: http://demo.codestag.com/geeklove/ but it only returns a single index.html wget --recursive --no-clobber --page-requisites --html-extension --convert-links ...
2
votes
2answers
434 views

Submit “&” to Drupal 6 form using cURL?

I'm using this code to create a node in Drupal 6: curl -b cookies.txt -d \ title="$(sed '1,/sblmtitle/d;/slpstitle/,$d' file.html)" \ -d form_build_id=form-5312da71abefb3bf1f63f1f2b7cf9105 \ ...
2
votes
1answer
47 views

Understanding two flags and a dollar sign in a CURL command

I right clicked a post request in Chrome and selected Copy as cURL I got a cURL command that includes the following --data-binary $'------WebKitFormBound I am used to seeing cURL requests that ...
2
votes
1answer
92 views

How to download .pdf files from pubmed

I can't download .pdf files from http://www.ncbi.nlm.nih.gov/pmc/articles, I already have some document IDs such as PMC3404089. I tried to issue the following command: curl -o file.pdf ...
2
votes
1answer
150 views

Given a mime-type get the corresponding file extension

I want to download I file using curl to a temporary directory with the appropriate extension. Currently I do something like this: tmp="$(mktemp -t 'curl')" curl -o "$tmp" ...
2
votes
1answer
2k views

Passing binary data to curl without using a @file

Is it possible to use curl and post binary data without passing in a file name? For example, you can post a form using binary via --data-binary: curl -X POST --data-binary @myfile.bin http://foo.com ...
2
votes
1answer
965 views

Use cookies in curl to set language

I need to curl | grep some data from a webpage but after setting language to English. In a browser, I can do this by clicking on a link. I first get the SelectCulture page and save the cookie in a ...
2
votes
1answer
428 views

Asking curl to skip missing files

Is there any way to tell curl not to download a file when it does not exist on the server? I am using my Mac OS X shell to download a few files with curl. The command goes: curl -s -# ...
2
votes
2answers
4k views

How can I install php5-curl on Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic x86_64)

I have a working server running Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic x86_64), including apache and php. Now I want to add curl support for php by running this: apt-get install php5-curl ...
2
votes
1answer
146 views

Is there a way to control the speed at which Curl reports progress?

I'm using Curl in Cygwin to automate a daily download. I want to keep progress in a log but Curl is just a little too noisy for my taste. I tried man curl and Google, but didn't find anything. Can I ...
2
votes
1answer
408 views

Predict filename before downloading from a URL, in shell script

I have a shell script that downloads files from a list using wget, and resumes automatically if there is any non-critical error (because of unstable WIFI during storms). The problem is, I want to ...
2
votes
1answer
1k views

Install php_http on Arch Linux

First I installed the curl extension for PHP: $ sudo pacman -S php-curl and $ grep curl /etc/php/php.ini extension=curl.so Then I installed the PHP PEAR $ sudo pacman -S php-pear Having now ...
2
votes
0answers
239 views

Nagios not running notify command

I am in the process of creating a notify command for our Nagios server to notify us via our Kannel SMS sender. This is what I got so far: /usr/local/bin/curl -v -G -d 'username=user' -d ...
2
votes
1answer
3k views

cURL/wget - SSLv3, TLS handshake, CERT hangs

I have problems connecting to https sites using cURL or wget. When I download from a https curl seems to be stuck while doing the TLS handshake, CERT. The problem is independent of the site (I noticed ...