Explanation of the touch Command in CentOS

Source: Internet
Author: User
Tags touch command
The touch Command in linux is not commonly used. it is generally used when you use make. The most common usage is touchfileA. if fileA exists, you can 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 & lt;
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
 <日期时间>
  
] [-R
  <参考文件或目录>
   
] [-T
   <日期时间>
    
] [-- 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
    <时间日期>
     
Use 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
     <参考文件或目录>
      
Set the date and time of the specified file or directory to the same date as that of the reference file or directory. -T
      <日期时间>
        Use 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] [-r Ref_file (reference file) |-t Time (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 file File The access time.   -C   Do not create files File.   -M   Modify file File modification time   -R Ref_file   Reference File Ref_file The corresponding time stamp value is used as the specified file File The new value of the time stamp.   -T Time   Use the specified time value Time As a specified file File The new value of the corresponding time stamp. Time Decimal 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.