Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@JaminShanti JaminShanti commented Aug 22, 2014

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

Nice work!

@ometa

This comment has been minimized.

Copy link

@ometa ometa commented Sep 2, 2016

Perfect, exactly what I was looking for. Thanks!

@davidcrx

This comment has been minimized.

Copy link

@davidcrx davidcrx commented May 3, 2018

Thanks! 👍

@ghost

This comment has been minimized.

Copy link

@ghost 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

This comment has been minimized.

Copy link

@outprogs 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