Linux Common Commands--touch

Source: Internet
Author: User
Tags touch command
touch 创建空文件夹及改变文件的时间戳

Syntax format: Touch "option" "File" touch [options] [file]
Attention:
1.mkdir commands and subsequent options and directories, each of which must have at least one space between each element
2. Everything in Linux is a file. Although the touch command cannot create a directory, you can modify the timestamp of the directory
Parameter options: a,m,d,r,t
Case one:
Create multiple files at the same time


Case TWO:
Change the timestamp of a file
Touch-a Ysg #<==-a change last accessed time

Touch-m ysg #<==-M changes the last modified time

Case THREE:
touch-d 20200501 data.txt Specifies the file modification time after the file is created

Touch-r 1.txt Test.txt Modify the properties of the Test.txt and match the 1.txt time properties

Touch-t 201805011030.50 Test.txt
-T is the time attribute for setting a file using [[CC]YY]MMDDHHMM[.SS] format time, that is, century, year, month, day, hour, minute, second

Linux Common 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.