Equivalent of Unix find command on Windows
With no additional cmdlets installed, you can simply use Get-ChildItem
:
Get-ChildItem -Filter *.zip -Recurse $pwd
The Find-ChildItem
Cmdlet in Windows Powershell is an equivalent of Unix/Linux find command
http://windows-powershell-scripts.blogspot.in/2009/08/unix-linux-find-equivalent-in.html
Some of Find-ChildItem Options
Find-ChildItem -Type f -Name ".*.exe"
Find-ChildItem -Type f -Name "\.c$" -Exec "Get-Content {} | Measure-Object -Line -Character -Word"
Find-ChildItem -Type f -Empty
Find-ChildItem -Type f -Empty -OutObject
Find-ChildItem -Type f -Empty -Delete
Find-ChildItem -Type f -Size +9M -Delete
Find-ChildItem -Type d
Find-ChildItem -Type f -Size +50m -WTime +5 -MaxDepth 1 -Delete
Disclosure: I am the developer of Find-ChildItem
cmdlet
dir <drive: [drive:]> /s | findstr /i <pattern>
- alternative -
dir /s <drive:>\<pattern>
example
dir c: d: /s | findstr /i example.txt
- alternative -
dir /s c:\example.txt