Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何使用Powershell执行find命令_Windows_Git_Powershell - Fatal编程技术网

Windows 如何使用Powershell执行find命令

Windows 如何使用Powershell执行find命令,windows,git,powershell,Windows,Git,Powershell,我正在学习Git的内部结构 当我尝试在Windows上使用cmder执行此命令时,会有一个更好的控制台 我犯了一个错误 我应该怎么做呢?Windows中的find.exe与linux中的find.exe不同 在PowerShell中查找[startpath]的等价物是: Get-ChildItem [startpath] -Name dir /B [startpath] 在cmd.exe中,它将是: Get-ChildItem [startpath] -Name dir /B [start

我正在学习Git的内部结构

当我尝试在Windows上使用cmder执行此命令时,会有一个更好的控制台

我犯了一个错误

我应该怎么做呢?

Windows中的find.exe与linux中的find.exe不同

在PowerShell中查找[startpath]的等价物是:

Get-ChildItem [startpath] -Name
dir /B [startpath]
在cmd.exe中,它将是:

Get-ChildItem [startpath] -Name
dir /B [startpath]
Windows中的find.exe与linux中的find不同

在PowerShell中查找[startpath]的等价物是:

Get-ChildItem [startpath] -Name
dir /B [startpath]
在cmd.exe中,它将是:

Get-ChildItem [startpath] -Name
dir /B [startpath]
相当于:

find foo -type f
。。。我使用:

Get-Children foo -Name -Recurse -File | % { $_ -replace "\\", "/" }
相当于:

find foo -type f
。。。我使用:

Get-Children foo -Name -Recurse -File | % { $_ -replace "\\", "/" }
使用FullName属性,否则如果路径较长,它将不显示全名:

(Get-ChildItem -Path 'C:\dist\work' -Force -Recurse -ErrorAction 'SilentlyContinue' -Filter "objects").FullName
C:\dist\work\bam-client\.git\objects
C:\dist\work\bam-extras\.git\objects
:
使用FullName属性,否则如果路径较长,它将不显示全名:

(Get-ChildItem -Path 'C:\dist\work' -Force -Recurse -ErrorAction 'SilentlyContinue' -Filter "objects").FullName
C:\dist\work\bam-client\.git\objects
C:\dist\work\bam-extras\.git\objects
:
那不应该是dir/S吗?还是我遗漏了什么?那不应该是dir/S吗?还是我遗漏了什么?