pikesaku’s blog

個人的な勉強メモです。記載内容について一切の責任は持ちません。

PowerShellでLinuxのfindからのgrepを実行する方法

Linuxの場合

find ./ -type -mmin -5 -exec grep "hoge" {} \;

PowerShellの場合

Get-ChildItem -Path ./ -Recurse -File | Where-Object {$_.lastwritetime -ge (get-date).AddMinutes(-5)} | Select-String "hoge"