A date command that cannot be ignored in Linux __linux

Source: Internet
Author: User

What a joke, the date order is not simple, before also introduced AH. Yes, the use of the date command is simple, today we say the small use of the date command. In some cases, if you think of the date command, it will provide a lot of convenience for the development effort.

For example, we all often go to compile programs, generate a static library or dynamic library, however, sometimes (after a period of time), we have to look at the time of library generation, at this point with ll command can, the problem is, the Linux system time May and actual time (or time zone) is not consistent, then how to do it. Let's not take the actual time, use the date command to check Linux's own time, such as:

[Taoge@localhost test]$ ll a.txt 
-rw-rw-r--1 taoge taoge 0 Oct-09:01 a.txt
[taoge@localhost test]$ 
[taoge@ localhost test]$ date
Tue Oct 09:10:43 PDT 2015
I looked at my watch, and now the actual time is a far cry from the Linux system time above. Let's just focus on the Linux time and see that A.txt was created about 9 minutes before the date command was executed.


In actual development, I often use ll and date to approximate determine how long Coussen became (presumably when generated), so as to probably verify that the library is a new generation, eliminate some interference, cool. In addition, when you need to change the Unix time stamp to the corresponding times, you can use date-d @xxxxxx command, where xxxxxx is the number of seconds. For example, date-d @0 corresponds to 1970 years of time.





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.