如何使用Powershell执行find命令

时间:2016-06-05 08:30:46

标签: windows git powershell

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

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

find .git/objects

我收到错误

enter image description here

我该怎么办?

3 个答案:

答案 0 :(得分:3)

相当于:

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

......我用:

OptimoUi::Application.routes.draw do
  require 'sidekiq/web'

  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)

  authenticate :admin_user do
    mount Sidekiq::Web => '/sidekiq'
  end

答案 1 :(得分:2)

Windows中的

spark-2.0.0-preview 相当于linux中的find.exe

PowerShell中的find相当于:

find [startpath]

并在Get-ChildItem [startpath] -Name 中,它将是:

cmd.exe

答案 2 :(得分:0)

使用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
: