In linux, touch command parameters are not commonly used. they may be used when you use make to modify the file timestamp or create a new file that does not exist. The following are touch command parameters in linux.
In linux, touch command parameters are not commonly used. they may be used when you use make to modify the file timestamp or create a new file that does not exist, the following describes how to use the touch command parameters in linux:
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 in the number of years, that is, the number of centuries. YY is the last two in the number of years, that is, the number of years in a century. if the CC value is not given, the touch command parameter in linux limits the number of years CCYY to within 1969--2068. MM indicates the number of months. DD indicates the number of years CCYY is limited. MM indicates the number of months, DD indicates the number of days, hh indicates the number of hours (when), mm indicates the number of minutes, and SS indicates 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.