DEV Community

Eldad Assis
Eldad Assis

Posted on

4 1

Get http code with wget

Sometimes I don't have curl available for me in a given environment. Some distributions don't provide it with the default installed utilities and I might not have the privileges to install it.
In such cases, I use wget, which is usually installed.

wget --spider -S -T 2 www.jfrog.org 2>&1 | grep "^  HTTP/" | awk '{print $2}' | tail -1

Run wget --help to see details about the parameters I use here.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay