1.

Linux下查找文件命令

find . -name '*log4j*'

2.

Windows下查找文件命令

C:\Program Files (x86)>dir /S /b | find /i "windef.h"

3.

Windows下查找包含某个字符串的文件

findstr /S /i "tchar.h" *.h

 

C:\Program Files (x86)>findstr /S /i "sizeof" *.h
VMware\VMware VIX\vm_basic_types.h:#define LAST_LPN ((((LA) 1) << (8 * sizeof(LA) - PAGE_SHIFT)) - 1)
VMware\VMware VIX\vm_basic_types.h:#define LAST_LPN32 ((((LA32)1) << (8 * sizeof(LA32) - PAGE_SHIFT)) - 1)
VMware\VMware VIX\vm_basic_types.h:#define LAST_LPN64 ((((LA64)1) << (8 * sizeof(LA64) - PAGE_SHIFT)) - 1)

4.

findstr支持正则表达式,如$表示行的终点

dir /S /b | findstr /i ".java$" 

如上可以过滤掉一些文件,如Action.java.svn-base