LoginSignup
7

More than 5 years have passed since last update.

date +%Y%m%d%H%M%S

Posted at

よく利用する date command ですが、よく使うオプションを忘れるのでメモしておきます。
日時付きのファイル名を作る際に便利です。

console
$ date +%Y%m%d%H%M%S
20171229122952
$ echo dummy > `date +%Y%m%d%H%M%S`.log
$ ls | grep 2017
20171229123027.log

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
7