Linux Ping Options

Since my introduction to bash scripting a couple of days ago, I decided while on the phone to my momma, to write a little script to monitor my internet connection. Being on the second floor with the router on the fifth floor, my connection can be a little ropey at times.

I did write the beginnings of a script, but while reading the ping man page (new window) I discovered a great little option called flood ping (-f) which instead of printing a new line for every ping response, prints a full stop (or period) “.” every time a ping is sent, and a backspace every time a response is received. Thus you see a list of dots appear if packets are being dropped, and nothing if packets are being received.

Exactly what I wanted, no scripting required! Gotta love linux…

Quick tech note, you need to set an interval unless you’re running ping as root, so the full command is “ping -fi 1 x.x.x.x” where 1 is the inverval in seconds an x.x.x.x is your destination address or hostname.

2 thoughts on “Linux Ping Options”

  1. Well Jeremy might wonder why he’s taking the lift to the fifth floor every day if he lives on the second floor, but you never know… :-p

Leave a Reply

Your email address will not be published. Required fields are marked *