The difference between CTime, Mtime, and Atime under the Find command

Source: Internet
Author: User

Find command:atime, Mtime, CTime differences:

Atime refers to access time, that is, when a file is read or executed, and the modification of a file does not change access times.

CTime is the change time file state changes, refers to the file I node was modified time, such as through chmod modify the file attributes, CTime will be modified.

Mtime, or modify time, refers to when the contents of a file have been modified .

Show file filename Contents:

Modify FileName Permission: chmod g+x filename;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/80/6E/wKiom1dBXlTz2Uj8AAAbyD7e4uw915.png "style=" float: none; "title=" 1.PNG "alt=" Wkiom1dbxltz2uj8aaabyd7e4uw915.png "/>

The changes appear as follows:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/80/6D/wKioL1dBX0Twzn_OAAALE-Yv0Xc715.png "style=" float: none; "title=" 2.PNG "alt=" Wkiol1dbx0twzn_oaaale-yv0xc715.png "/>

Then execute: find-cmin-5, shown as follows:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/80/6E/wKiom1dBXlXRQ_ULAAALc8gNGyU370.png "style=" float: none; "title=" 3.PNG "alt=" Wkiom1dbxlxrq_ulaaalc8gngyu370.png "/>

Modify the contents of the file and then execute find-mmin-5, as shown below:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/80/6E/wKiom1dBXlbxUpNGAAAjzjX7Xdw229.png "style=" float: none; "title=" 4.PNG "alt=" Wkiom1dbxlbxupngaaajzjx7xdw229.png "/>

Enter Find-amin-5, as shown below:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/80/6E/wKiom1dBXlaiwUseAAAMmLYQSs4576.png "style=" float: none; "title=" 5.PNG "alt=" Wkiom1dbxlaiwuseaaammlyqss4576.png "/>



-mtime-n +n by file change time to find files,-n refers to n days or less, +n refers to n days ago

-atime-n +n by file access time to find files,-n refers to n days or less, +n refers to n days ago

-ctime-n +n by file creation time to find files,-n refers to n days, +n refers to n days ago

-name finds files by file name.

-perm to find files according to file permissions.

-prune Use this option to make the Find command not be checked in the currently specified directory

If you use the-depth option at the same time, the-prune will be ignored by the Find command.

-user Search for files according to the owner of the file.

-group finds files according to the group to which the files belong.

-mtime-n +n to find a file according to the time the file was changed-n indicates the text

The change time is less than n days, + n means that the file change time is now n days from

Ago. The Find command also has the-atime and-ctime options, but they both and the-m time

option is the same.

-type find a file of a certain type;

Example: B-block device files;

D-Directory C-character device file P-pipe file L-Connection file F-Normal file

-size N:[c] Find files with a file length of n blocks, with a C-time representation of the file in bytes;


This article is from the "Stream Wind" blog, please be sure to keep this source http://xiexiankun.blog.51cto.com/10785425/1775879

The difference between CTime, Mtime, and Atime under the Find command

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.