29
29

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linux でミリ秒まで表示するワンライナー時計

Posted at

Linux の date コマンドを使うとナノ秒まで表示出来ます。
また常に時刻を表示してたい時がたまにあったりします。

そんな時は以下のワンライナーを使うとコンソールに常に時間をミリ秒まで表示することが出来ます。

while true ; do printf "\r%.12s" `date +%T.%N`; sleep 0.01 ; done

oneliner-date.gif

29
29
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
29

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?