Linux change time find, Find command to find files modified in recent days

Guided reading

find

is a handy tool to find files on your system. Files that have been changed in the last few days can be found. This will be the focus of this tutorial.

Timestamp type of the file

file with the following timestamps:

atime: Displays the last time the file was read or accessed.

amin: show how many minutes ago the file was last read or accessed

mtime: Displays the last time the file or program modified the file. When the file content is changed or modified, the mtime also changes. “Modification” means appending certain data to a file, reorganizing or deleting some or all of it.

mmin: Displays the last time the file was modified in minutes.

ctime: show when file attributes were modified

Use the -mtime option

In this section, we will focus on how to use the mtime option to search for files with timestamps within a certain range. This lists files accessed a few days ago.

Example 1: Find files in the /var/log folder that have been modified for more than 90 days.

[root@localhost ~]# find /var/log -mtime 90 -print

in

-mtime 90 plus sign means greater than the following days

f37bf1fed61c3ef687757d4e3a8cba48.png

Example 2: Find configuration files in the /etc folder whose modification time is less than 10 days

[root@localhost ~]# find /etc -iname “*conf*” -mtime -10 -print

9c6f98563a715fdedccec1bc35aad26d.png

in…

The post linux change time find, the Find command to find files modified in recent days first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9875
This site is for inclusion only, and the copyright belongs to the original author.