Linux Commands---Touch

Source: Internet
Author: User

Touch:change file timestamps changing the timestamp
Common options:
-A change the file's access time to the current time
-M change the file's modified content time to the current time
-C Change the CTime time of the file to the current time, that is, modify the file's properties and permissions time
Instance:

[[email protected] ~]# touch a.txt   #创建空文件,常用[[email protected] ~]# ls -l a.txt-rw-r--r--. 1 root root 0 Aug 26 05:30 a.txt[[email protected] ~]# ls -l --time=atime test.txt      #访问时间-rw-r--r--. 1 root root 610 Aug 26 05:01 test.txt[[email protected] ~]# ls -l --time=ctime test.txt      #修改属性与权限时间-rw-r--r--. 1 root root 610 Aug 23 05:04 test.txt[[email protected] ~]# ls -l test.txt                          #更改文件内容的时间-rw-r--r--. 1 root root 610 Aug 23 05:04 test.txt[[email protected] ~]# touch -a test.txt                  #更改文件的访问时间为当前时间[[email protected] ~]# ll --time=atime test.txt-rw-r--r--. 1 root root 610 Aug 26 05:26 test.txt[[email protected] ~]# touch -m test.txt                #更改文件修改内容的时间[[email protected] ~]# ll test.txt-rw-r--r--. 1 root root 610 Aug 26 05:29 test.txt

Linux Commands---Touch

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.