Functions of touch in Linux

Source: Internet
Author: User
Tags touch command

Most common usage: 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: changes the file or directory time.

Syntax: touch [-ACFM] [-D <date and time>] [-r <reference file or directory>] [-T <date and time>] [-- 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 <time and date> uses 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 <reference file or directory> sets the date and time of the specified file or directory to the same date as that of the reference file or directory.
-T <date and time> uses the specified date and time instead of the current time.
-- Help Online Help.
-- Version: displays the version information.

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.