Usage of the date command below Linux (top)

Source: Internet
Author: User

First, Introduction


The date in Liunx is a very common command used to display the modified time, as follows


Second, the syntax format


usage:date [OPTION] ... [+format]


Iii. Common Options

%y #显示年份的最后两位

%Y #显示Full year

%m #显示月份

%M #显示分钟

%h #显示月

%H #显示小时

%s # from January 1, 1970 00:00:00 to the number of seconds currently experienced
%I #显示小时12小时制的

%K #显示小时24小时制的

%s #显示秒

%c #显示日期和时间

%d #显示日


Iv. Common time settings (refer to the online article collation)

Date-s//Set current time, only root privileges can be set, others can only be viewed.

Date-s 20150523//set to 20150523, this will set the specific time to empty 00:00:00

Date-s 01:01:01//Set time, no changes made to date

Date-s "01:01:01 2015-05-23″//so you can set the whole time

Date-s "01:01:01 20150523″//so you can set the whole time

Date-s "2015-05-23 01:01:01″//so you can set the whole time

Date-s "20150523 01:01:01″//so you can set the whole time












This article is from the "10852974" blog, please be sure to keep this source http://10862974.blog.51cto.com/10852974/1774151

Usage of the date command below Linux (top)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.