Windows – List of recently changed files for a directory and all subdirectories

command linefilesystemswindowswindows 7

In Linux I know this command to find and list the latest modified files in a directory with all its subdirectories.

find /var/www/ -type f -exec stat --format '%Y :%y %n' {} \; | sort -nr | cut -d: -f2- | head

Is there a Windows CLI equivalent?

Best Answer

PowerShell 2.0

Latest 10 changed files

Dir C:\folder -r | ? {! $_.PSIsContainer} | sort LastWriteTime | select -last 10

Changed files since given date

Dir C:\folder -r | ? {! $_.PSIsContainer -AND $_.lastwritetime -ge '04/18/14'} 

Read more on http://ss64.com/ps/

Related Question