2

How do I print only an IP address list of a traceroute run?

I don't want the web addresses like something-online.net and their round trip times.

How do I get a "simple" traceroute from the terminal?

1
  • You need to add an example of what output you're currently seeing and what you are looking for. This is too vague. Sep 1, 2011 at 8:21

2 Answers 2

6

Are you looking for traceroute -n? From the man page:

   -n     Do not try to map IP addresses to  host  names  when  displaying
          them.

Edit: Comment added further requirement of removing round trip times.

To display everything except round trip times (sequence and IP address), CSV-formatted:

traceroute -n 8.8.8.8 | tail -n+2 | awk '{ print $1 "," $2 }'
2
  • yes, but how do I out it to a csv file without the round trip times in ms?
    – epsilon8
    Sep 1, 2011 at 8:25
  • Pipe the output into awk to print only the IP columns.
    – Gareth
    Sep 1, 2011 at 8:31
1

Building on Dave Sherohman's answer. As I'm using using MinGW64, I only have access to tracert and not traceroute.

tracert uses the -d flag instead of the -n flag:

  -d                 Do not resolve addresses to hostnames.

And, here's some example output:

$ tracert -d 8.8.8.8 | tail -n+2 | awk '{ print $8 }'
of

10.7.7.1
169.57.0.194
169.57.118.132
50.97.19.110
50.97.19.113
50.97.16.37

108.170.231.15
8.8.8.8

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .