linux常用命令(十二)

 时间:2026-05-05 07:00:17

1、date

命令功能:date 可以用来显示或设定系统的日期与时间。

linux常用命令(十二)

2、格式化输出

[root@gongsi-A shell]# date "+%Y-%m-%d %H:%M:%S"

2019-08-19 17:46:10

linux常用命令(十二)

3、输出昨天日期

[root@gongsi-A shell]# date -d '-1 days' '+%F' 

2019-08-18

linux常用命令(十二)

4、设置具体时间

[root@gongsi-A shell]# date -s "2012-05-23"         

Wed May 23 00:00:00 CST 2012

linux常用命令(十二)

5、简单输出日期和时间

%F %T参数

[root@gongsi-A shell]# date "+%F %T"

2012-05-23 00:01:12

linux常用命令(十二)

6、使用date产生随机数

[root@gongsi-A shell]# date +%N

383871020

[root@gongsi-A shell]# date +%N

175733092

linux常用命令(十二)

  • Linux apache服务常用命令
  • linux常用命令(五)
  • linux常用命令(一)
  • linux常用命令(三)
  • linux常用命令(十二)
  • 热门搜索
    影影绰绰的意思 喜出望外的意思 租金计入什么科目 for是什么意思 jane是什么意思 百合花象征什么 赤芍的作用与功效 敝帚自珍的意思 神经节苷脂的作用 白色象征什么