Reputation: 333
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
Reputation: 1
Try find2.exe application https://github.com/fernandoarbe/find2
cd \home\user\data
find2 test
Upvotes: 0
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
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
Reputation: 6860
You will looking for Get-ChildItem
Get-ChildItem C:\Test -Filter "*test*"
Upvotes: 7