Windows tasklist and findstr, playing with the command line

A short story, so that I don't forget... about the Windows equivalent of ps and grep and kill.

Examples of use:

tasklist | findstr -ir \svchost

svchost.exe 1212 Console 0 1.672 K
svchost.exe 1292 Console 0 1.748 K
svchost.exe 1408 Console 0 13.812 K
svchost.exe 1640 Console 0 1.316 K
svchost.exe 1712 Console 0 4.312 K
svchost.exe 3904 Console 0 1.860 K
svchost.exe 2256 Console 0 3.440 K

This would look like ps -ef | grep svchost* in the *NIX world; though I expect you'd find no processes called svchost ;-)

Comments

Lexei — 2010-10-08 17:10

There is also taskkill, that can terminate a process, ex:
taskkill /F /IM explorer.exe /T