Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find files modified between two dates on Linux machine [closed]

Tags:

linux

unix

On Linux/Unix machine how do I find files modified between a certain number of days ago ? For example say between 2 and 5 days ago, not calendar dates but days ago from right now. So files modified more than 2 days ago, but not more than 5 days days ago. It would not return anything that was modified yesterday, for example.

like image 498
dheer_krish Avatar asked Feb 15 '26 16:02

dheer_krish


1 Answers

If you want to do it on the Unix command line, try using find with the -mtime option.

Example:

find /home -iname ".c" -mtime 2 -mtime -4

will choose files modified two to four days ago.

like image 139
Gargi Srinivas Avatar answered Feb 18 '26 06:02

Gargi Srinivas