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.