3rd Chapter Basic Bash Shell commands (2)

Source: Internet
Author: User
Tags touch command

Create a file

You will always encounter situations where empty files are created. Sometimes the application wants a log file to exist before they can write the data. At this point, you can easily create an empty file using the Touch command.

Touch creates an empty file and takes your user name as the owner of the file. The file size is 0 because you built an empty file.

Touchls -l test_one10 :  test_one$

Touch modifies the file access time and modification time to the current time, which does not modify the file contents

ls -l test_one10:+Touch  ls -l test_one10: test_one$

To modify access time, you need to use the-a parameter. But actually, CTime was changed with Atime.

You can use the- T parameter to specify a time instead of the current time [YY]MMDDHHMM[.SS] month day minutes and seconds

3rd Chapter Basic Bash Shell commands (2)

Related Article

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.