目录和所有子目录的最近更改的文件列表

Joh*_*mBF 14 windows windows-7 filesystems command-line

在 Linux 中,我知道这个命令可以在一个目录及其所有子目录中查找并列出最新修改的文​​件。

find /var/www/ -type f -exec stat --format '%Y :%y %n' {} \; | sort -nr | cut -d: -f2- | head
Run Code Online (Sandbox Code Playgroud)

是否有等效的 Windows CLI?

nix*_*xda 22

PowerShell 2.0

最近 10 个更改的文件

Dir C:\folder -r | ? {! $_.PSIsContainer} | sort LastWriteTime | select -last 10
Run Code Online (Sandbox Code Playgroud)

自给定日期以来更改的文件

Dir C:\folder -r | ? {! $_.PSIsContainer -AND $_.lastwritetime -ge '04/18/14'} 
Run Code Online (Sandbox Code Playgroud)

http://ss64.com/ps/上阅读更多信息