In Linux, find the file modified in a specified time period-find command

Source: Internet
Author: User

In linux, we can directly use the find function to search for a specified time file with relevant parameters. This is the same as finding a file, but it has different parameters.

If you do not remember to modify the file in linux, you need to find the file that has been modified within the specified time. In this case, you can use the find command to find the file.

Find/opt-iname "*"-atime 1-type f

[Find the files accessed by/opt the next day]

OPTIONS

All options always return true values, and they will always be executed unless they are placed in a place that cannot be executed in the expression. Therefore, to be clear, it is best to place them at the beginning of the expression.
 
-Daystart
Calculate the time (for-amin,-atime,-cmin,-ctime,-mmin, and-mtime) from the start time of the day instead of before 24 hours ).
 
-Amin n
The last access to the file was n minutes ago.
 
-Anewer file
The last access to the file is later than the modification time of the file. If-follow in the command line is earlier than-anewer, (and only in this case-anewer will be affected by-follow ).
 
-Atime n
The last access to the file was n * 24 hours ago.
 
-Cmin n
The last modification to the file status was n minutes ago.
 
-Cnewer file
The last modification to the file status is later than the modification time of the file. If-follow in the command line is earlier than-cnewer, (and only in this case-cnewer will be affected by-follow ).
 
-Ctime n
The last modification to the file status was made n * 24 hours ago.
 
-Mmin n
The last modification to the file data was made n minutes ago.
 
-Mtime n
The last modification to the file data was made n * 24 hours ago.
 
-Mtime: indicates the object that has been modified at the specified time? Hot failover? Tomb? Br/>
-Ctime: specifies the time when the file has been changed. This indicates that the file permission has been changed.
 
-Atime: a file that has been accessed at a specified time, meaning that the file has been read.
1. The time is in the unit of 24 hours instead of the day.
2. Can I start searching for a day at a.m. on February 1? Magpie mould? 1/09/07 ~ ? Que Nai? Br/>
Find the files modified 3 days ago (Files earlier than the third day before) (> 72 hours)
 
Find/var/log/-mtime + 3-type f-print
3 days? Missing Mu ?? Nead ~ 2011/09/08? 00? Que Nai? (0 ~ 72 hours ??
 
Find/var/log/-mtime-3-type f-print
Find the files modified in the previous 3rd days ~ ? Que Nai? (72 ~ 96 hours)
 
Find/var/log/-mtime 3-type f-print
Find the file that has been modified in the last day (you can also write it like this)
 
Find/var/log/-mtime + 2-mtime-4-type f-print

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.