Use the find command in linux to find files based on system time

Source: Internet
Author: User
This article describes how to use the find command to search for files based on the timestamp of your system. For more information, see LinuxFind

These timestamps include


Copy codeThe code is as follows:
Last modification time of mtime file content
Time when the atime file is read or accessed
Ctime file status change time

Mtime and atime are both easy to understand, while ctime requires more explanations. Inode maintains the metadata of each file. Therefore, if the metadata related to the file changes, the inode data also changes. This may be caused by a series of operations, including creating symbolic links to files, changing file permissions, or moving files. In these cases, the file content will not be read or modified, so mtime and atime will not change, but ctime will change.

These time options must be used together with a value of n, specified as-n, n or + n.


Copy codeThe code is as follows:
N * 24
+ 1 indicates 1x24 + 24 hours away ..
+ 0 indicates 0x24 + 24 hours away
1 indicates the range from 1x24 + 24 to 24 ..
0 indicates 0*24 + 24 to 0 ..
-1 indicates 0*24 + 24, or even the future time...

1. Current time: 24 hours-current time (yesterday-today)
# Find.-mtime 0
2. Current Time 48 hours ago-current time 24 hours ago (the day before yesterday)
# Find.-mtime 1
3. the current time is 48 hours ago (2 days ago)
# Find.-mtime + 1
4. Current time: 24 hours-current time (yesterday-today)
# Find.-mtime-1

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.