windows powershell 实现类似 grep 的效果
source link: https://hellodk.cn/post/414
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
windows powershell 实现类似 grep 的效果
windows powershell 下使用 ps
命令可以查看当前所有的 process name
但是如何才能像 linux 那样使用 ps |grep nginx
那样 只输出和字符串 nginx 相匹配的进程呢?
ps | Out-String -stream | sls nginx
可以实现类似 grep 的效果
关于 powershell
的 Out-String
可以翻阅微软官方文档 https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-string?view=powershell-7.1
powershell
执行 ps
命令后每一列的含义见图
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK