not_ur_avg_cookie
not_ur_avg_cookie

Reputation: 333

Windows Equivalent to Linux: Find -name

I am trying to figure out a command in the CLI which I know in Linux Ubuntu but I need to apply it in Microsoft.

Moreover, I am trying to find all files within a folder with a specific name. Particularly, I try to find all files which contain the term 'test' in their name. Here is the command which I know in Linux:

find \home\user\data -name '*test*'

Does anyone know the equivalent in the windows command line?

Upvotes: 4

Views: 5800

Answers (4)

Try find2.exe application https://github.com/fernandoarbe/find2

cd \home\user\data
find2 test

Upvotes: 0

Sergio Tanaka
Sergio Tanaka

Reputation: 1435

In PowerShell you can use Get-ChildItem to find files and folders.

If you want to use regular expressions, you can combine Get-ChildItem with the Select-String or Where-Object cmdlets.

Get-ChildItem -Path C:\ -Recurse | Select-String -pattern "Regex"
Get-ChildItem -Path C:\ -Recurse | Where-Object -FilterScript {$_.name -match "regex"}

Upvotes: 3

Ryan Keshock
Ryan Keshock

Reputation: 11

You're looking for the "dir" command. To accomplish the same thing as your original search, you would use

dir \home\user\data "*test*"

Upvotes: 1

ArcSet
ArcSet

Reputation: 6860

You will looking for Get-ChildItem

Get-ChildItem C:\Test -Filter "*test*"

Upvotes: 7

Related Questions