linux常用命令(十二)

 时间:2026-02-22 06:12:57

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常用命令(十二)
  • 热门搜索
    红眼病怎么传染 怎么泡妞 台式电脑怎么设置密码 马桶漏水怎么办 来例假肚子疼怎么缓解 怎么练胸肌 苹果怎么做好吃 celine怎么读 荷兰豆怎么做好吃 钒怎么读