Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use 'find' to search for files created on a specific date? [closed]

Tags:

find

bash

unix

How do I use the UNIX command find to search for files created on a specific date?

like image 317
sverrejoh Avatar asked Oct 11 '22 17:10

sverrejoh


People also ask

How do I search for files on a Mac for a specific date?

But yes, just go to the Finder, press Command + F to bring up a Finder window, then change the filters to search "This Mac", and "Last modified date" is "after" <your date> to see all your modified documents.

How do I search by date modified?

Click in the search box to make the Search Tools tab available on the ribbon, then click the Date modified button and choose one of the available options. That click automatically enters the Datemodified: operator in the search box.


1 Answers

As pointed out by Max, you can't, but checking files modified or accessed is not all that hard. I wrote a tutorial about this, as late as today. The essence of which is to use -newerXY and ! -newerXY:

Example: To find all files modified on the 7th of June, 2007:

$ find . -type f -newermt 2007-06-07 ! -newermt 2007-06-08

To find all files accessed on the 29th of september, 2008:

$ find . -type f -newerat 2008-09-29 ! -newerat 2008-09-30

Or, files which had their permission changed on the same day:

$ find . -type f -newerct 2008-09-29 ! -newerct 2008-09-30

If you don't change permissions on the file, 'c' would normally correspond to the creation date, though.

like image 381
Arve Avatar answered Oct 24 '22 16:10

Arve