Linux touch command

Source: Internet
Author: User
Linux touch commands are not commonly used. They are generally used when you use make to modify the file timestamp or create a new file that does not exist.
Touch [-ACM] [-r ref_file (reference file) |-t time (time value)] File (file name)
Example:
Touch file1.txt update file1.txt access and modification time
Touch-C file1.txt if file1.txt does not exist, no file is created
Touch-r ref_file file1.txt updates file1.txt with the same timestamp as REF + File
Touch-T 0811142234.50 file1.txt: the time when the file is set to be incorrect is, January 1, November 14.

-
Modify the file access time.
-C
Do not create file.
-M
Modify the file modification time

-R ref_file
Use the corresponding timestamp value of the ref_file object as the new timestamp value of the specified file.
-T time
Use the specified time value time as the new value of the corresponding time stamp of the specified file. The time here is defined as the following decimal number:

[[CC] YY] mmddhhmm [. SS]


Here, CC is the first two digits of the number of years, that is, the number of centuries. yy is the last two digits of the number of years, that is, the number of years in a century. If the value of CC is not given, touch
The number of years ccyy will be limited to within 1969--2068.mm is the number of months, DD is the number of years ccyy is limited to 1969--2068.mm is the number of months, DD is the number of days, HH
It is the number of hours, mm is the number of minutes, and SS is the number of seconds. the second is set to 0--61, which can process leap seconds. the time composed of these numbers is a time in the time zone specified by the Environment Variable tz.
Due to system restrictions, the time earlier than January 1, January 1, 1970 is incorrect.

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.