Linux命令之date +%F
date命令显示当前日期
date +%F显示当前日期
[10:02:52 root@C8[ 2020-06-16DIR]#touch `hostname`_`date +%F`.log
[10:03:47 root@C8[ 2020-06-16DIR]#ll
total 0
-rw-r--r--. 1 root root 0 Jun 16 10:03 C8_2020-06-16.log
[10:03:48 root@C8[ 2020-06-16DIR]#ls
C8_2020-06-16.log
[10:03:54 root@C8[ 2020-06-16DIR]#touch `hostname`_`whoami`_`date +%F`.log
[10:04:13 root@C8[ 2020-06-16DIR]#ll
total 0
-rw-r--r--. 1 root root 0 Jun 16 10:03 C8_2020-06-16.log
-rw-r--r--. 1 root root 0 Jun 16 10:04 C8_root_2020-06-16.log
date命令显示当前据1970-1-1有多少天
[pang@C8-1 root]$ date --help |grep 1970
%s seconds since 1970-01-01 00:00:00 UTC
Convert seconds since the epoch (1970-01-01 UTC) to a date
[pang@C8-1 root]$ echo `date +%s`/86400 |bc
18445
[pang@C8-1 root]$ date +%F
2020-07-02
* * *
胖并快乐着的死肥宅
* * *