Linux instructions: Archive directory management - Touch

xiaoxiao2021-03-06  91

Name: Touch Use Permissions: All users use mode: touch [-ACFM] [-r reference-file] [-file = reference-file] [-t mmddhhmm [[cc] yy] [. Ss]] [ D Time] [--DATE = TIME] [--Time = {Atime, Access, Use, Mtime, Modify}] [--NO-CREATE] [--HELP] [--Version] file1 [file2 ... ] Description: Touch instruction changes the time record of the file. LS -L can display the time record of the file. Parameters: a Changing the read time record of the file. M change the modification time record of the file. C If the purpose file does not exist, it will not establish a new file. Like -No-Create. F is not used, is to retain to compatibility with other UNIX systems. R Use the reference file time record, like the effect of thefile. D Setting time and date, you can use a variety of different formats. T Time Record of the file is set, the format is the same as the DATE instruction. --NO-CREATE does not establish a new file. --Help lists the instruction format. --Version lists this message. Example: The easiest way of use is changed to the current time when the file is recorded. If the file does not exist, a new file will be established. Touch File Touch File1 File2 changed File's time record to 18:39, BC, twom. Time format can refer to the Date directive, at least you need to enter MMDDHHMM, which is the time of months and minutes. Touch -c -t 05061803 file touch -c -t 050618032000 file change the file time records to ReferenceFile. Touch -R Referencefile File changed the time record of File to 18:3:39 on May 6, two thousand years old. Time can be used in AM, PM or 24-hour format, and other formats can be used in other formats such as 6 May 2000. Touch -d "6:03 PM" File Touch -d "05/06/2000" File Touch -d "6:03 PM 05/06/2000" File Touch can also make a neutral (0 Byte). For example, DHCP Server The required /etc/dhcpd.Leases ,DHCPD must have this file to work properly. [Root @ / root] #touch /et@ dd ## leas-l /et@/root]#ls-l /etc/dhcpd.Leases- RW-R - R - 1 ROOT ROOT 0 JUL 3 05:50 /etc/dhcpd.Leases Remember to put the set file under / etc before the last heavy storing Tar, then restore the original settings after remember However, it is found that the system checks the setting of the setting file. This time, use FIND / etc -name * -exec touch {}; you can update the time update of the setting file to the present.

转载请注明原文地址:https://www.9cbs.com/read-123775.html

New Post(0)