Linux of the Touch commands are not commonly used, generally in use Make may be used to modify the file timestamp, or to create a new file that does not exist. .
1 . command format:
Touch [ options] ... File ...
2 . Command parameters:
-A or--time=atime or--time=access or--time=use only change the access time.
- C or--no-create do not create any documents.
- D use the specified date time instead of the current time.
- F This parameter ignores non-processing and is responsible only for compatibility issues with BSD version touch directives.
- M or--time=mtime or--time=modify only change the change time.
- R sets the datetime of the specified document or directory to the same date and time as the reference document or directory.
- T use the specified date time instead of the current time.
3 . Command function:
Touch the command parameter can change the date time of the document or directory, including access time and change time.
4 . Examples of use:
Instance one: Create a file that does not exist
Command:
[[email protected] wxj]# Touch 123.txt
Output:
[Email protected]]# ll
Total Dosage 0
[[Email protected]]# Touch 123.txt
[Email protected]]# ll
Total Dosage 0
-rw-r--r--1 root root 0 3 Month 8 01:19123.txt
[[Email protected]]#
Example three: Setting the timestamp of a file
Command:
[Email protected] wxj]# touch-t 201212311111.11 123.txt
Output:
[Email protected]]# ll
Total Dosage 0
-rw-r--r--1 root root 0 Month 123.txt
[Email protected]]# touch-t 201212311111.11 123.txt
[Email protected]]# ll
Total Dosage 0
-rw-r--r--1 root root 0 Month 123.txt
[[Email protected]]#
This article from "Flat Light is true" blog, please be sure to keep this source http://wuxiujian.blog.51cto.com/10583235/1748950
Touch to modify the file timestamp, or create a new file that does not exist-copy