如何在Windows中的目录和子目录中找到所有头文件

时间:2018-12-16 17:46:50

标签: cmd find window command-line-interface

我最近开始在Windows操作系统(2012 R2)上工作,我试图在我的目录及其子目录中查找标头格式(* .h)的所有文件。

这是我在linux shell中运行时得到的方式:

find /auto/sw_work/fwshared/ibrahims/git/svx/pci_verification -name "*.h"   

我得到以下结果:

/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/BlockStateMainProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/BlueFieldBdfProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/CfgLastIndexProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/CfgLastIndexPropertyProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/ComponentIsUpstreamProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/ConfigTraceProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/DmesgProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/DriverProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/HeaderLogProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/HotPlugProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/I1FrequencyProperty.h
/auto/sw_work/fwshared/ibrahims/git/svx/pci_verification/pci_properties/src/LinkEqProperty.h

在Windows命令行中运行时如何获得以下结果?

提前谢谢。

1 个答案:

答案 0 :(得分:3)

那很简单。

列出文件的命令是dir。有关各种开关,请参见dir /?

dir /s /b "\auto\sw_work\fwshared\ibrahims\git\svx\pci_verification\*.h"

/s开关看起来是递归的(包括 s 文件夹),/b开关将以 b 格式显示文件(无标题) ,没有摘要,时间戳或大小)

注意:Windows中的目录分隔符是\,而不是Unix / Linux中的/

相关问题