Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find files on Windows modified after a given date using the command line

Tags:

I need to search a file on my disk modified after a given date using the command line.

For example:

   dir /S /B WHERE modified date > 12/07/2013 
like image 415
Daniel Peñalba Avatar asked Jul 12 '13 13:07

Daniel Peñalba


People also ask

How do I find files modified after a certain date?

In the File Explorer ribbon, switch to the Search tab and click the Date Modified button. You'll see a list of predefined options like Today, Last Week, Last Month, and so on. Pick any of them. The text search box changes to reflect your choice and Windows performs the search.

How do I search for a date modified in Windows 10?

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.

How can you find all files in your home directory that were modified in the last seven days?

/directory/path/ is the directory path where to look for files that have been modified. Replace it with the path of the directory where you want to look for files that have been modified in the last N days. -mtime -N is used to match files that had their data modified in the last N days.


1 Answers

The forfiles command works without resorting to PowerShell. The article is here:

Find files based on modified time

Microsoft Technet documentation: forfiles

For the example above:

forfiles /P <dir> /S /D +12/07/2013 
  • /P The starting path to search
  • /S Recurse into sub-directories
  • /D Date to search, the "+" means "greater than" or "since"
like image 54
John Jesus Avatar answered Oct 15 '22 22:10

John Jesus