Example of linux touch command usage
The linux touch command explains:
1. Command function:
Timestamps for creating files and modifying files or directories
2. Command syntax:
Touch [option] [file name or directory name]
3. Command parameters:
-a modify only the access (access) time of the file.
-c or-- no-create does not create files that do not exist.
-d uses the specified date time instead of the current time
-m refers to the modified Modify time, but not the access time
-r file updates the timestamp of the specified file file with the timestamp (access,modify) of the file (access,modify)
Note: access indicates the time when the file was last accessed (only access, no changes)
Modify indicates the time when the file was last modified
Change indicates the time when the file properties were last changed, including permissions, size, attributes, etc.
-t change the time to the date specified by the parameter, for example: 07081556 represents 15:56 on July 8th
4. Examples of use:
Create files that do not exist, such as under the / data directory:
Modify the access (access) time of the file, such as the access time of the westoslinux in the figure above
Modify (modification) time of a modified file, such as modify time of a modified / data/westoslinux file
Use the specified time to change the access or modify time of a file or directory. For example, to modify the access time of the file in the figure above is 2012-07-15 08:30:30, you only need to change the parameter a to m to modify the modify timestamp.
These are the details of the linux touch command, please pay attention to other related articles!