Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Linux Find command to find files within a specified time range

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use the Linux Find command to find files within a specified time range". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

For example, to find files between `0808` and `2013-01`, you can use the following command:

The code is as follows:

Find / log/-name 'production.log-2013*'-newermt' 2013-08-08'!-newermt '2013-09-0

If the search starts at 12:00 on 2011-09-08, documents within the time from 12:00 on 2011-09-07 to 12:00 on 2011-09-08 will be listed.

Find files that have been altered "previously" for 3 days (files before 12:00 on 2011-09-05 on the third day before →) (> 72 hours)

The code is as follows:

Find / var/log/-mtime + 3-type f-print

Find out the documents that have been altered within 3 days (from 12:00 on 2011-09-05 to 12:00 on 2011-09-08) (within 0 ~ 72 hours)

The code is as follows:

Find / var/log/-mtime-3-type f-print

Find files that have been altered on the third day before (within 12:00 on 2011-09-04 to 12:00 on 2011-09-05) (72-96 hours)

The code is as follows:

Find / var/log/-mtime 3-type f-print

Find out the files that have been altered on day 3 (you can also write this way)

The code is as follows:

Find / var/log/-mtime + 2-mtime-4-type f-print

This is the end of the content of "how to use the Linux Find command to find files within a specified time range". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report