Atime, ctime and mtime, atime, ctimemtime

Source: Internet
Author: User

Atime, ctime and mtime, atime, ctimemtime

1. atime, ctime, and mtime

Atime refers to access time, that isTime when the file is read or executed(Modifying the file does not change the access time ).

Ctime is change time,File status change timeThe time when the I node of the file is modified. For example, if you modify the file attribute through chmod, The ctime is modified.

Mtime is modify time, which indicatesTime when the file content was modified.

 

Use stat to view the atime, ctime, and mtime of the file.

Stat/etc/passwd
File: '/etc/passwd'
Size: 1381 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768 dInode: 399683 Links: 1
Access: (0644/-rw-r --) Uid: (0/root) Gid: (0/root)
Access: 23:53:40. 096000003 + 0800
Modify: 14:16:07. 037115838 + 0800
Change: 14:16:07. 038115837 + 0800

 

You can also use ls to view the atime, ctime, and mtime of the file.

In general, the ls-l/etc/passwd we use indicates the modify time of the file.

Ls-lu/etc/passwd or ls-l-time = atime/etc/passwd indicates the access time of the file.

Ls-lc/etc/passwd or ls-l-time = ctime/etc/passwd indicates the change time of the file.

 

Touch can be used to change these three times. We will not introduce how to use touch to change atime, ctime, and mtime.

 

 

2. find.-parameter n in mtime

In find.-mtime n, n indicates 24 * n, and + n,-n, and n indicate:

+ N: greater than n

-N: less than n

N: equal to n

 

Find.-mtime n: File was last modified n * 24 hours ago.

The last modification takes place n * 24 hours to (n + 1) * 24 hours from the current time.

Find.-mtime + n:

The last modification takes place n + 1 days ago and is 24 hours or earlier than the current time (n + 1 ).

Find.-mtime-n:

The last modification takes place within n days and is less than n * 24 hours from the current time.

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.