Explanation of the touch command in CentOS

Source: Internet
Author: User

Explanation of the touch command in CentOS

Linux touch commands are not commonly used and may be used when you use make.
The most common usage is touch fileA. If fileA exists, use the touch command to change the date and time of the file or directory, including the access time and change time. If fileA does not exist, the touch command creates a blank file fileA in the current directory. Touch command details Function Description: Change the file or directory time. Syntax: touch [-acfm] [-d <date and time>] [-r <reference file or directory>] [-t <date and time>] [-- help] [-- version] [file or directory...] or touch [-acfm] [-- help] [-- version] [Date and time] [file or directory...] note: You can use the touch command to change the date and time of a file or directory, including the access time and change time. Parameters:-a or -- time = atime or -- time = access or -- time = use only change the access time. -C or -- no-create does not create any files. -D <time and date> uses the specified date and time instead of the current time. -F this parameter will not be processed. It is only responsible for solving the compatibility problem of the BSD touch command. -M or -- time = mtime or -- time = modify only changes the change time. -R <reference file or directory> sets the date and time of the specified file or directory to the same date as that of the reference file or directory. -T <date and time> uses the specified date and time instead of the current time. -- Help Online help. -- Version: displays the version information.
 
The touch command in linux is not commonly used. It may be used when you use make to modify the file timestamp or create a new file that does not exist.[-Acm] [-rRef_file (reference file) |-tTime (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, if you do not create a file touch-r ref_file file1.txt, the time stamp of file1.txt is the same as that of ref + file. touch-t 0811142234.50 file1.txt. The file time is incorrect. It is, January 1, November 14.
-Modify fileFileThe access time.-CDo not create filesFile.-MModify fileFile modification time-RRef_fileReference FileRef_fileThe corresponding time stamp value is used as the specified fileFileThe new value of the time stamp.-TTimeUse the specified time valueTimeAs a specified fileFileThe new value of the corresponding time stamp.TimeDecimal format as follows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.