Linux 等效于 ps -A | Windows 中的 grep -c 进程?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10153087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:46:42  来源:igfitidea点击:

Equivalent of ps -A | grep -c process in Windows?

windowslinuxprocessgrepps

提问by Marcin

I am looking for an equivalent/alternative of Linux's ps -A | grep -c script.phpfor ms windows ?

我正在ps -A | grep -c script.php为 ms windows寻找 Linux 的等效/替代方案?

cheers, /Marcin

干杯,/马辛

采纳答案by Dmitry Reznik

Simple commands:

简单命令:

tasklist | FIND "script.php"

回答by Alex Nolasco

An alternative solution to the accepted answer

已接受答案的替代解决方案

tasklist /fi "Imagename eq script*"

In case you need this in a loop

如果你需要这个循环

for /l %x in (1, 0, 2) do (timeout /t 2 | tasklist /fi "Imagename eq script*")

Source: https://technet.microsoft.com/en-us/library/bb491010.aspx

来源:https: //technet.microsoft.com/en-us/library/bb491010.aspx