/

A Beginner's Guide to Using the traceroute Command in Linux

A Beginner’s Guide to Using the traceroute Command in Linux

Are you curious about the path your packets take when reaching a specific host on the internet? The traceroute command is an essential tool for tracking the nodes your packets traverse to reach their destination.

To make use of the traceroute command, simply enter the following command in your Linux terminal:

1
traceroute <host>

This command will collect the necessary information while the packet travels, providing you with valuable insights into the network path. Let’s take a look at an example using the command traceroute flaviocopes.com.

Screenshot of traceroute command

It’s important to note that not every router along the path will return information. When this happens, the traceroute command will display * * *. However, for the routers that do provide information, you’ll see the hostname, IP address, and some performance indicators.

By default, traceroute displays three samples for each router, giving you a good indication of the time required to reach it. This is why the traceroute command takes longer to execute compared to a simple ping to the host.

If you prefer to customize the number of samples, you can use the -q option, like this:

1
traceroute -q 1 flaviocopes.com

Screenshot of customized traceroute command

Keep in mind that the traceroute command works on Linux, macOS, Windows Subsystem for Linux (WSL), and any UNIX-like environment.

tags: [“Linux commands”, “traceroute”, “network analysis”, “Linux networking”, “command line tools”]