[Linux] file Time attribute and touch Command

Source: Internet
Author: User
Tags touch command
Linux files have three time attributes: 1) mtime: The last modification time of the file content; 2) ctime: the time when the file status changes, such as permission and attribute changes. 3) atime: the time when the file content is accessed, such as cat and less. by default, ls displays the mtime of the file, that is, the file

Linux files have three time attributes:

1) mtime: The last modification time of the file content

2) ctime: the time when the file status changes, such as permission and attribute changes.

3) atime: the time when the file content is accessed, such as cat and less.

By default, ls displays the mtime of the file, that is, the last modification time of the file content. if you need to view the other two times, you can add the -- time parameter, as shown below:

# Ls-l/etc/man. config-rw-r --. 1 root 4940 Feb 22 2013/etc/man. config # ls-l -- time ctime/etc/man. config-rw-r --. 1 root 4940 Nov 5 20:14/etc/man. config # ls-l -- time atime/etc/man. config-rw-r --. 1 root 4940 Dec 20/etc/man. config

The touch Command can modify the file Time. its usage is as follows:

If no date is specified, the default value is the system date touch-d file touch-d "" file touch-d "pm". if no time is specified for file, the default value is 00: 00: 00 touch-d 20000506 file touch-d "05/06/2000" file touch-d "20000506" filetouch-d "pm 05/06/2000" file touch-d "20000506" file touch-d" 20000506 18:03:00 "file

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.