Linux Touch Command Detailed

Source: Internet
Author: User
Tags touch command

The Touch command has two features:

One is used to update the time label of the existing file to the current time of the system (the default), their data will remain intact;

The second is to create a new empty file.

Touch Common Command Parameters
-A change-only the access time-c,--no-create does not create any files-d,--date=string par Se STRING and use it instead of time-f (ignored)-H,--no-dereference affect each symbolic li                       NK instead of any referenced file (useful only on systems that can change the Timestamps of a symlink)-m change only for the modification time-r,--reference=file Use this FILE ' s Tim Es instead of current time-t STAMP use [[CC]YY]MMDDHHMM[.SS] instead of current Time--time=word C                         Hange The specified Time:word is access, atime, or Use:equivalent to-a WORD is modify or mtime:equivalent to-m--help Display this help and exit--version output version Informatio N and exit

Common Command Display


Touch: Create File1-file10 total of 10 files

Touch file{1..10}

Set the timestamp of the file

Touch-t 201810121230 hh.sh "-T in decimal number"

Update Log.log the same time as Log2012.log timestamp

Touch-r hh hh.sh    "touch-r destination file  source file"

Linux Touch Command Detailed

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.