PowerShell FINDSTR eqivalent?

后端 未结 8 934
栀梦
栀梦 2021-02-02 09:28

What\'s the DOS FINDSTR equivalent for PowerShell? I need to search a bunch of log files for \"ERROR\".

8条回答
  •  伪装坚强ぢ
    2021-02-02 10:02

    For example, find all instances of "#include" in the c files in this directory and all sub-directories.

    gci -r -i *.c | select-string "#include"
    

    gci is an alias for get-childitem

提交回复
热议问题