Quantcast
Channel: Linux Explore » Linux hacks
Viewing all articles
Browse latest Browse all 9

date/time stamp in ping command

$
0
0

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.


Filed under: Linux Explore Tips & Tricks Tagged: bash, date, echo, intowire, Linux, Linux hacks, Linux Tips, Linux Tricks, ping, time, xargs

Viewing all articles
Browse latest Browse all 9

Trending Articles