Check Your Public IP Address with curl
One-liner to print the outbound public IPv4 address of your router or VPN from the command line.
01Command
$ curl -s https://api.ipify.org02What it does
The -s flag silences curl's progress meter so only the address itself is printed, which is ideal in scripts and shell prompts. ipify is a lightweight echo service that simply returns the IP the request arrived from, so what you see is exactly the address websites and servers will associate with your traffic. If the value changes between runs, your ISP uses dynamic addresses or your VPN is rotating exits.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- curl(1) — Ubuntu man pageEvidence: Man page text contains -s (silent mode) and -o (write output to file) option descriptions, confirming the flags used in the command.
- curl(1) — Linux man pageEvidence: Documents '-s/--silent' (silent or quiet mode, don't show progress meter) and '-o/--output'; confirms the '-s' flag text on the page.
Last verified: 2026-09-19 · Category: Network
06Related solutions
One command that prints every interface with its state and IPv4/IPv6 addresses in a short table — the modern, memorable replacement for digging through `ifconfig` or the verbose `ip addr` output.
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.
Add a UFW rule to permit inbound traffic on a TCP or UDP port, such as SSH on port 22.