| « Erori în Chişinău | Cartoon heroes and personalities » |
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.
- tasklist - display a list of processes that are currently running on the system
- findstr - search a string in a given file or text excerpt
- taskkill - terminate a running process
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 KThis would look like ps -ef | grep svchost* in the *NIX world; though I expect you'd find no processes called svchost ;-)
1 comment
Comment from: Lexei [Visitor]
There is also taskkill, that can terminate a process, ex:
taskkill /F /IM explorer.exe /T
taskkill /F /IM explorer.exe /T
2010-Oct-08, Fri @ 11:10