One-step modification of linux system time

Source: Internet
Author: User
Article Title: One-Step modification of linux system time. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Today, I don't want to take a long review, but I want to write something skillful.

Let's talk about how to set the system time in one step in linux. Anyone who does experiments on linux virtual machines will know. When you restore linux to a certain point, vmware cannot help you reset the system time. So we need to do it manually at this time. About how to set the linux time. There are many introductions on the Internet, but they are all copied. How can we set the system time efficiently and quickly?

At the beginning, or on the Internet, for example, set the time To 18:30:50.

We will first set the date

Date-s 20091112

Reset time

Date-s 18:30:50

I'm glad to say that you will get bored when you have more machines. Is there a one-step solution? Several searches have found that!

Date 111218302009 (month, day, and year)

This can be achieved in one step. But! But what? For linux, such a writing method is too human and hard to remember. Is there a simpler way? After several explorations, I found that there are!

Date-s "20091112 18:30:50"

In this way, you can put it in place in one step, and it is easy to remember. It took a long time to steal the video. Generally, I don't tell him ~

After the time is set, it is saved. If you shut down normally, let's talk about it. It will be saved once when the system is off, but if you may not shut down normally, you can save the settings first.

Hwclock -- systohc

That's the case. Most of the statements on the Internet are:

Clock-w or hwclock-w

After careful analysis, you will know that clock is the soft link of hwclock. The-w parameter is not mentioned in help and man of hwclock. I don't know the year when-w was written. Most of the articles on the Internet are-w :)

To sum up, set the linux system time in one step:

Date-s "20091112 18:30:50" & hwclock -- systohc

This article is from the "rainbird" blog, please be sure to keep this source http://rainbird.blog.51cto.com/211214/226327

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.