Find files modified more than 1 hour ago but less than 3 days

In linux using bash, what is the easiest way to find files that were modified more than an hour ago but less than 3 days ago?

Of course, there should be an easy way to do this. I continue to search and cannot find an easy solution.

+5
source share
2 answers

Find has -mtime and -mmin:

find . -mtime +3 -mmin -60 

In the search guide:

Numeric arguments can be specified as:

+ n is greater than n

-n is less than n

n for exactly n

+7
source

That should be enough: find . -mtime -3 -mmin +60 find . -mtime -3 -mmin +60

I just tried:

find ./ -mtime -3 -mmin +60 -exec ls -lhrt {} \; | awk '{print $5" "$6" "$7" "$8}'

0
source

Source: https://habr.com/ru/post/1232856/


All Articles