windows
在powershell中查看 D:\tmp\txtSplit下所有.txt格式文件中,“httpClientResult–nat result,”这个字符的相关信息,输出在命令行中
Get-ChildItem "D:\tmp\txtSplit\**.txt" | Select-String "httpClientResult--nat result," | ForEach-Object {
Write-Host "文件: $($_.Path)"
Write-Host "行号: $($_.LineNumber)"
Write-Host "内容: $($_.Line)"
Write-Host "-----------------------"
}
在powershell中查看 D:\tmp\txtSplit下所有.txt格式文件中,“httpClientResult–nat result,”这个字符的相关信息,输出在指定文件中
Get-ChildItem "D:\tmp\resource_collect*.log" |
Select-String "pool-23-thread-2" |
ForEach-Object {
"文件: $($_.Path)"
"行号: $($_.LineNumber)"
"内容: $($_.Line)"
"-----------------------"
} |
Out-File -FilePath "D:\tmp\monitor_collect_output.txt" -Encoding UTF8
Linux
grep -rn 'ResourceFlavorStatistics.batchSave.resourceStatisticList.all:' ./