xxxxxxxxxx
# Windows CMD search pipe output
C:\> netstat -na | findstr /c:"PORT"
# Windows PowerShell search pipe output
PS C:\> netstat -na | Select-String "PORT"
# Windows CMD search in a file
C:\> findstr /i /r /c:"^SEARCH.*STRING$" file.txt
# Windows PowerShell search in a file
PS C:\> Select-String "^SEARCH.*STRING$" file.txt
xxxxxxxxxx
Use findstr in Windows with following command line structure:
findstr [/I] [/S] "substring" "regex_file_name"
/I Case-insensitive search.
/S Search files in subfolders recursively.