Forrest logo
back to the ping tool

ttyplot:tldr:c258b

ttyplot: Parse the output from `ping` and visualize it.
$ ping ${8-8-8-8} | sed -u '${s-^-*time=--g; s- ms--g}' | ttyplot -t "${ping to 8-8-8-8}" -u ${ms}
try on your machine

This command performs a series of operations using the utilities ping, sed, and ttyplot in order to display and plot the results of a ping test to the 8.8.8.8 IP address.

Let's dissect the command step by step:

  1. ping ${8-8-8-8}: This initiates a ping test to the IP address 8.8.8.8. The ${8-8-8-8} is a way to add this IP address as an argument to the ping command.

  2. |: This symbol is a pipe, used to pass the output of one command as input to the next command.

  3. sed -u '${s-^-*time=--g; s- ms--g}': The sed command is used here to modify the output of the ping command. -u specifies that sed should output each line immediately, instead of buffering it. The following expression ${s-^-*time=--g; s- ms--g} is a sed script that performs two substitutions on each line:

    • s-^-*time=--g replaces the leading * character (which is used to indicate packet loss) with time=. This helps in retrieving the ping time value for plotting.
    • s- ms--g removes the ms substring, which is the unit of the ping time.
  4. |: Another pipe symbol, passing the output of the previous sed command to the next command.

  5. ttyplot -t "${ping to 8-8-8-8}" -u ${ms}: This command uses ttyplot to plot the ping times received from the previous commands. The -t "${ping to 8-8-8-8}" option sets the plot's title as "ping to 8.8.8.8", and -u ${ms} sets the y-axis unit as milliseconds.

In summary, this command performs a ping test to 8.8.8.8, modifies the output to retrieve the ping times, and then plots those times using ttyplot with the specified title and unit.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ping tool