Skip to content

Instantly share code, notes, and snippets.

@antonbabenko
Created January 12, 2012 14:44
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save antonbabenko/1600911 to your computer and use it in GitHub Desktop.
Save antonbabenko/1600911 to your computer and use it in GitHub Desktop.
Curl list of urls and save http response code & times (useful for cache warmup)
#!/bin/bash
while read LINE; do
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{time_starttransfer} %{url_effective}\n' "$LINE" >> urls_result.txt
done < urls.txt
@JaminShanti
Copy link

I knew someone would fix this. I wish the -o /dev/null worked with -K url = "site"

Nice work!

@ometa
Copy link

ometa commented Sep 2, 2016

Perfect, exactly what I was looking for. Thanks!

@davidcrx
Copy link

davidcrx commented May 3, 2018

Thanks! 👍

Copy link

ghost commented May 14, 2018

An idea... We can set interval (sleep) after each request to limit the load if running from the server side.

@outprogs
Copy link

outprogs commented Aug 1, 2019

Well done, thanks. This help me a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment