Command referencetraceroute
traceroute command (Linux / bash / sh / zsh)
What it does
Trace the network hops taken toward a destination. When people search for the traceroute command linux hops, they usually want traceroute's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.
Trace the network hops taken toward a destination.
Syntax
traceroute [OPTION]... HOST [PACKET_LENGTH]
Common options
| Flag / option | Meaning |
|---|---|
| -n | Do not resolve hop addresses to names. |
| -m HOPS | Set the maximum hop count. |
| -I | Use ICMP echo probes. |
| -T | Use TCP SYN probes. |
| -p PORT | Set the destination port. |
Practical examples
Trace route
traceroute example.com
Displays responding hops toward the host.
Numeric trace
traceroute -n 8.8.8.8
Avoids DNS lookup delays.
TCP trace
sudo traceroute -T -p 443 example.com
Traces with TCP probes to HTTPS.
Linux ↔ Windows equivalent
Closest match: tracert (Windows / CMD). Trace routers traversed on the way to an IP destination.
Common mistakes
- Assuming every `*` means packet loss at the final destination.
- Reading asymmetric hop timings as a precise map of the return path.
Related commands
- pingTest IP reachability and measure round-trip response time.
- tracertTrace routers traversed on the way to an IP destination.
- ssInspect network sockets, listeners, and connection statistics.
- ipconfigDisplay and manage Windows IP configuration and DNS client state.
- pingTest reachability and measure response time with ICMP echo requests.
- curlTransfer data to or from URLs using many network protocols.
- sshOpen a secure remote shell or run a command over SSH.
- Invoke-WebRequestSend HTTP and HTTPS requests and return response metadata and content.
FAQ
What does traceroute do in Linux?
Trace the network hops taken toward a destination.
How do I use traceroute from the terminal?
Start with `traceroute [OPTION]... HOST [PACKET_LENGTH]`, then choose only the options needed for the task.
What is a practical traceroute example?
Try `traceroute example.com` — Displays responding hops toward the host.
Can I use traceroute in a shell script?
Yes. traceroute works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.