Use curl on the command line for some quick information on a URL

One neat trick I use a fair bit is hitting URLs on the command line using curl. The most common use case I have for it is checking redirects but if you start using the command you’ll see there’s actually a fair bit of information handed back to you when you type the following in your command line:

curl -I

There are loads of things you can do with the curl command and you should definitely check the manual – using man curl – to explore but by using the -I flag, we can request only the headers for the URL we want to inspect.

Here’s the entry in the manual for that flag:

Here’s a quick look at what you can expect when using the command:

One last thing…

If you liked this article, I'd be incredibly grateful if you tweeted about it.

Also, I don't send emails often but when I do, I try to fill them full of useful goodies. If you like code snippets & dev tips, join my mailing list. There's no catch but I'll probably want to tell you about any new plugins & tools I build.