显示当前时间,格式2016-06-18 10:20:30
[root@centos7 data]# date +"%F %T"
2019-10-24 14:38:36
显示前天是星期几
[root@centos7 ~]# date -d "-2 day" +%a
Tue
设置当前日期为2019-08-07 06:05:10
[root@centos7 ~]# date -s "2019-08-07 06:05:10"
Wed Aug 7 06:05:10 CST 2019
显示当前时间,格式2016-06-18 10:20:30
[root@centos7 data]# date +"%F %T"
2019-10-24 14:38:36
显示前天是星期几
[root@centos7 ~]# date -d "-2 day" +%a
Tue
设置当前日期为2019-08-07 06:05:10
[root@centos7 ~]# date -s "2019-08-07 06:05:10"
Wed Aug 7 06:05:10 CST 2019