showkey
showkey

Reputation: 358

How to locate the specified directory with powershell?

Powershell installed on my debian8.
To locate the specified directory with bash.

sudo find /  -name  'vim74'
/usr/share/vim/vim74

Here is my try with powershell.

Get-ChildItem -Path /  -Filter 'vim74'

Nothing output,how to fix it ?

There are two problem for running

Get-ChildItem -Path / -Filter 'vim74' -Recurse

1.no permission
2.so many wrong path

enter image description here

Upvotes: 2

Views: 155

Answers (1)

Bluecakes
Bluecakes

Reputation: 2149

By default, Get-ChildItem will only search the directory you give it so you're not getting any results because there is no file/folder matching vim74 in your root path /

You need to use the -Recurse parameter in order to also search subfolders like so:

Get-ChildItem -Path / -Filter 'vim74' -Recurse

To see what you can do with Get-ChildItem you can look at the help using:

Get-Help -Name Get-ChildItem -Full

Upvotes: 2

Related Questions