如何使用Powershell执行find命令

use*_*291 2 windows git powershell

我正在学习 Git 内部https://git-scm.com/book/en/v1/Git-Internals-Git-Objects

当我尝试在 Windows 上执行此命令时(使用 cmder 更好的控制台http://cmder.net/

find .git/objects
Run Code Online (Sandbox Code Playgroud)

我收到一个错误

在此输入图像描述

我该怎么办?

Mat*_*sen 7

find.exeWindows 中的功能与 Linux 中的功能不同find

在 PowerShell 中相当于find [startpath]

Get-ChildItem [startpath] -Name
Run Code Online (Sandbox Code Playgroud)

在 中cmd.exe,它将是:

dir /B [startpath]
Run Code Online (Sandbox Code Playgroud)


小智 6

相当于:

find foo -type f
Run Code Online (Sandbox Code Playgroud)

... 我用:

Get-Children foo -Name -Recurse -File | % { $_ -replace "\\", "/" }
Run Code Online (Sandbox Code Playgroud)