cmd(window )和shell(linux) 命令行查找进程并杀进程

 cmd查找杀进程

rem 查看所有进程所有字段信息,并输出到文件process-list.properties
wmic process list full > process-list.properties

rem 查看相关进程关键字段信息,并输出到文件process-list-column.properties。注意bat里面需要用双%
wmic process where "Name = '%%java%%' and CommandLine like '%%java%%'" get processid,Name,CommandLine,ExecutablePath > process-select.properties


rem 查找并杀进程,两种方式,一种是delete,一种是call terminate。注意bat里面需要用双%
wmic process where "commandLine like '%%rb-assistant%%' and Name='javaw.exe'" delete
wmic process where "commandLine like '%%rb-assistant%%' and Name='java.exe'" delete
wmic process where "commandLine like '%%rb-assistant%%' and Name='javaw.exe'" call terminate
wmic process where "commandLine like '%%rb-assistant%%' and Name='java.exe'" call terminate

 

posted on 2021-01-14 11:40  小石头小祖宗  阅读(38)  评论(0编辑  收藏  举报  来源

导航