Kamis, 16 Januari 2014

Snippets: Real-time display of `date` changes on Linux

In Linux environment, sometime you need how to know the time in realtime. With date command, you will see what the time is. But how to make it realtime?

With this simple command, you will see what is date command changes on your shell/console.

{ while true ; do date ; sleep 0.1 ; done } | uniq

And the result like this:
joe@srv-iix:~$ { while true ; do date ; sleep 0.1 ; done } | uniq
Thu Jan 16 20:05:38 CIT 2014
Thu Jan 16 20:05:39 CIT 2014
Thu Jan 16 20:05:40 CIT 2014
Thu Jan 16 20:05:41 CIT 2014

Date's output will be appeared frequently until you pressing CTRL+C on your shell/console.

That's it for my first snippet :)

0 komentar:

Posting Komentar