date/time stamp in ping command

Most of you are very familiar with ping command which is most commonly used to check any network device is alive or not. A very simple and useful command. And if we can add date/time stamp in it, it will be more helpful to generate a good statistics. It is very easy in Linux without doing any extra development, simply need to combine few commands to work together.

You can combine few commands, to tweak the ping command as follows:

ping localhost | xargs -n1 -i bash -c ‘echo `date +%F\ %T`” {}”‘

For more information, Click here.

2 thoughts on “date/time stamp in ping command

  1. Pingback: <° Linux | Comando ping con fecha y hora de respuesta +colores

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s