发布于 2014-07-25 07:52:55 | 389 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Linux常用命令,程序狗速度看过来!

Linux

Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户、多任务、支持多线程和多CPU的操作系统。它能运行主要的UNIX工具软件、应用程序和网络协议。


本文讲解了linux下shell中的date命令及显示昨天,前天,前几天或明天,后天后几天的命令写法。喜欢的同学看一下。
[root@localhost shell]# date   
Tue Jul  5 04:58:08 CST 2011
[root@localhost shell]# date    显示系统当前日期
Tue Jul  5 04:58:15 CST 2011
[root@localhost shell]# date 2011-07-06
date: invalid date `2011-07-06'
[root@localhost shell]# date -s 2011-07-06    修改当前日期
Wed Jul  6 00:00:00 CST 2011
[root@localhost shell]# date     显示修改后的日期
Wed Jul  6 00:00:02 CST 2011
[root@localhost shell]# date -d "+4 day"   显示4天后的日期
Sun Jul 10 00:00:27 CST 2011
[root@localhost shell]# date -d "+4 day" +%y%m%d   格式化显示
110710
[root@localhost shell]# date -d "+4 day" +%Y%m%d   格式化显示
20110710
[root@localhost shell]# date -d "-4 day" +%Y%m%d  4天前
20110702
[root@localhost shell]# date -d "yesterday" +%Y%m%d   显示昨天
20110705

[root@localhost shell]# date -d "-1 day" +%Y%m%d   同上面一样,显示昨天,只不过写法不一样。
20110705

[root@localhost shell]# date -d "tomorrow" +%Y%m%d   显示明天
20110707

[root@localhost shell]# date -d "2 days ago" +%Y%m%d   显示2天前
20110704



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务