NAME
Touch-change file Timestamps--changing the time History of files
Synopsis
Touch [OPTION] ... FILE ...
DESCRIPTION
Update the access and modification times of each FILE to the current
Time. --Use the touch command to change the date and time of a file or directory, including access time and change time.
Mandatory arguments to long options is Mandatory for short options
Too.
-A change only the access time-changes the file's read history
-C,--no-create
Don't create any files--if the target does not exist, no new issues are created.
-D,--date=string
Parse STRING and use it instead of the current time
--Set the format of the time and date, not the current time.
-F (ignored)-not used, reserved for compatibility with other UNIX systems
-M change is only the modification time--only changes are made
-R,--reference=file
Use the This file echnical's times instead of the current time
--Set the date and time of the specified file or directory to the same date and time as the reference file or directory
-T STAMP
use [[CC]YY]MMDDHHMM[.SS] instead of the current time
--Set the format of the time and date, not the current time.
When the command is used. I know here that I can use it to create an empty file.
Such as:
[[email protected] ~]$ Touch AA--Build a file of AA
[Email protected] ~]$ ls-l--full-time--The case in Linux is very sensitive, just like C.
ls:unrecognized option '--full-time '
Try ' ls--help ' for more information.
[[email protected] ~]$ ls-l--full-time--Display list
Total 12
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:11:49.000000000 +0800 AA
Drwxrwxr-x 2 ok_008 ok_008 4096 2007-09-28 17:05:35.000000000 +0800 ok008filed
[[Email Protected]tos4 ~]$ Touch {bb.txt,cc.txt,dd.txt}
[Email protected] ~]$ ls-l--full-time
Total 24
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:11:49.000000000 +0800 AA
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:28.000000000 +0800 bb.txt
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:28.000000000 +0800 cc.txt
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:28.000000000 +0800 dd.txt--Notice the time of this line
Drwxrwxr-x 2 ok_008 ok_008 4096 2007-09-28 17:05:35.000000000 +0800 ok008filed
[[email protected] ~]$ Touch {dd.txt,ee.txt}--here to re-establish multiple files, note that dd.txt and the previous code write Dd.txt time display.
[Email protected] ~]$ ls-l--full-time
Total 40
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:11:49.000000000 +0800 AA
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:52.000000000 +0800 bb
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:28.000000000 +0800 bb.txt
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:52.000000000 +0800 cc
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:28.000000000 +0800 cc.txt
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:12:52.000000000 +0800 DD
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:13:13.000000000 +0800 dd.txt--Notice the time of this line
-rw-rw-r--1 ok_008 ok_008 0 2007-09-28 17:13:13.000000000 +0800 ee.txt
Drwxrwxr-x 2 ok_008 ok_008 4096 2007-09-28 17:05:35.000000000 +0800 ok008filed
[Email protected] ~]$
[[Email protected] ~]$ RM aa BB bb.txt cc cc.txt DD dd.txt ee.txt--delete several empty files just created
[[email protected] ~]$ ls
Ok008filed
This may explain the effect of the touch command, which is known in reference and in practice for its modified meaning.
The Linux learning Note 9--touch command is used