What is the equivalent of Linux’s wget command on a stock macOS system?

On Linux, I can perform an HTTP GET request from the terminal using wget, but macOS doesn’t include it by default. Since I can’t install third-party software, I need a built-in alternative that works on a standard macOS setup for fetching URLs or testing HTTP requests directly from the shell.

I’ve been in this exact situation, macOS doesn’t come with wget by default, but the built-in curl command usually does the trick.

It’s super powerful and works right out of the box:

curl -O http://example.com/file.txt

Here, -O saves the file with its original name. I usually use curl because it’s flexible and you can do everything wget does, plus some extra options like headers, authentication, and more.

If you just want to fetch the contents of a URL and see it in your terminal (like testing HTTP requests), you can do:

curl http://example.com

It prints the response to the terminal. I often use this for quick testing before I decide to download anything, super handy for debugging endpoints or checking URLs quickly.

This is a bit of a niche trick, but if you want a “native GUI-friendly” approach without installing anything:

osascript -e 'do shell script "curl -O http://example.com/file.txt"'

I’ve used this when scripting downloads in macOS workflows, it runs curl through AppleScript, which can be handy for automation or combining with other macOS tools.