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 find files and find empty folders according to file modification time by find in windows system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article shows you how to find files and find empty folders according to the file modification time in the windows system, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Find the file that was modified two days ago:

Find. -type f-mtime-2

Find files that have been modified within 3 days:

Find-ctime-3

The find command has been used for more than 6 days, and the empty file independent query command:

Find / data/backup-ctime + 6-exec rm-f {}\; delete files in the / data/backup directory that have been modified for more than 6 days.

Find / data/backup-type d-empty-exec rmdir {}\; > / dev/null 2 > & 1 Delete the empty folder under the / data/backup directory and output correct and error information to empty.

Look for find commands that are empty for more than 6 days:

Find. /-type d-empty-ctime + 6

To find the file by modification time, use the option-mtime:

Find / home/admin-mtime-1 # find files in / home/admin directory that were modified within 1 day

Find / home/admin-name * .txt-mtime-1 # find files in the / home/admin directory whose modification time is less than 1 day. Files with the end of .txt

Find finds files by file modification time

-- (+ n)-|-(n)-|-(n)

(nasty 1) * before 24H | (nasty 1) * between 24H~n*24H | within nasty 24H

-ctime-n to find files that have been modified within the current 24H.

-ctime n to find files that have been modified within (nasty 1) * 24H before nasty 24H.

-ctime + n to find files that have been modified before (nasty 1) * 24H

[a | c | m] min [Last visit | Last status modification | Last content modification] min

[a | c | m] time [Last visit | Last status modification | Last content modification] time

Three times for linux files (take find as an example):

The last visit time of atime, such as ls, more, etc., but chmod, chown, ls, stat, etc. will not change some time. You can view it in this chronological order using ls-utl.

The last state modification time of ctime, such as chmod, chown, etc., but the modification time will not change. You can view it using stat file.

When the last content modification time of mtime, such as after vi is saved, etc., if the modification time changes, atime and ctime will also change accordingly.

Note:

The creation time of a file is not recorded in linux, and unless the file has not changed since it was created, its creation time is the last time it was modified.

# ls-lt / home/admin # View in order of modification time

# ls-lut / home/admin # View by access time order

(you need to add an option-r if you want to view it in reverse order.)

The above content is how to find files and find empty folders according to the file modification time in the windows system. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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